Skip to content
Snippets Groups Projects
Commit 1c40b051 authored by jan.bednarik's avatar jan.bednarik
Browse files

Add name collision id to Author and User types.

parent 62235959
No related branches found
No related tags found
No related merge requests found
...@@ -87,6 +87,7 @@ class User(graphene.ObjectType): ...@@ -87,6 +87,7 @@ class User(graphene.ObjectType):
openid_uid = graphene.String() openid_uid = graphene.String()
first_name = graphene.String() first_name = graphene.String()
last_name = graphene.String() last_name = graphene.String()
name_collision_id = graphene.Int()
email = graphene.String() email = graphene.String()
is_author = graphene.Boolean() is_author = graphene.Boolean()
extra = JSONString() extra = JSONString()
...@@ -101,6 +102,7 @@ class User(graphene.ObjectType): ...@@ -101,6 +102,7 @@ class User(graphene.ObjectType):
openid_uid=user.openid_uid, openid_uid=user.openid_uid,
first_name=user.first_name, first_name=user.first_name,
last_name=user.last_name, last_name=user.last_name,
name_collision_id=user.name_collision_id,
email=user.email, email=user.email,
is_author=user.is_author, is_author=user.is_author,
extra=user.extra, extra=user.extra,
...@@ -118,6 +120,7 @@ class User(graphene.ObjectType): ...@@ -118,6 +120,7 @@ class User(graphene.ObjectType):
class Author(graphene.ObjectType): class Author(graphene.ObjectType):
first_name = graphene.String() first_name = graphene.String()
last_name = graphene.String() last_name = graphene.String()
name_collision_id = graphene.Int()
total_reports = graphene.Int() total_reports = graphene.Int()
extra = JSONString() extra = JSONString()
reports = relay.ConnectionField(ReportConnection) reports = relay.ConnectionField(ReportConnection)
...@@ -131,6 +134,7 @@ class Author(graphene.ObjectType): ...@@ -131,6 +134,7 @@ class Author(graphene.ObjectType):
id=user.id, id=user.id,
first_name=user.first_name, first_name=user.first_name,
last_name=user.last_name, last_name=user.last_name,
name_collision_id=user.name_collision_id,
extra=user.extra, extra=user.extra,
total_reports=user.total_reports, total_reports=user.total_reports,
) )
......
...@@ -18,6 +18,7 @@ snapshots['test_all 1'] = { ...@@ -18,6 +18,7 @@ snapshots['test_all 1'] = {
'firstName': 'Shaun', 'firstName': 'Shaun',
'id': 'QXV0aG9yOjM=', 'id': 'QXV0aG9yOjM=',
'lastName': 'Sheep', 'lastName': 'Sheep',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
}, },
...@@ -28,6 +29,7 @@ snapshots['test_all 1'] = { ...@@ -28,6 +29,7 @@ snapshots['test_all 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
}, },
...@@ -38,6 +40,7 @@ snapshots['test_all 1'] = { ...@@ -38,6 +40,7 @@ snapshots['test_all 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
} }
...@@ -64,6 +67,7 @@ snapshots['test_first 1'] = { ...@@ -64,6 +67,7 @@ snapshots['test_first 1'] = {
'firstName': 'Shaun', 'firstName': 'Shaun',
'id': 'QXV0aG9yOjM=', 'id': 'QXV0aG9yOjM=',
'lastName': 'Sheep', 'lastName': 'Sheep',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
}, },
...@@ -74,6 +78,7 @@ snapshots['test_first 1'] = { ...@@ -74,6 +78,7 @@ snapshots['test_first 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
} }
...@@ -100,6 +105,7 @@ snapshots['test_first_after 1'] = { ...@@ -100,6 +105,7 @@ snapshots['test_first_after 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
} }
...@@ -143,6 +149,7 @@ snapshots['test_last_before 1'] = { ...@@ -143,6 +149,7 @@ snapshots['test_last_before 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
} }
...@@ -168,6 +175,7 @@ snapshots['test_with_reports 1'] = { ...@@ -168,6 +175,7 @@ snapshots['test_with_reports 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'reports': { 'reports': {
'edges': [ 'edges': [
{ {
......
...@@ -23,6 +23,7 @@ snapshots['test_author 1'] = { ...@@ -23,6 +23,7 @@ snapshots['test_author 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjU=', 'id': 'QXV0aG9yOjU=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 0 'totalReports': 0
} }
} }
...@@ -42,6 +43,7 @@ snapshots['test_report 1'] = { ...@@ -42,6 +43,7 @@ snapshots['test_report 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 1 'totalReports': 1
}, },
'body': 'Long story short: we got the Ring!', 'body': 'Long story short: we got the Ring!',
...@@ -78,6 +80,7 @@ snapshots['test_user 1'] = { ...@@ -78,6 +80,7 @@ snapshots['test_user 1'] = {
'id': 'VXNlcjo4', 'id': 'VXNlcjo4',
'isAuthor': False, 'isAuthor': False,
'lastName': 'Einstein', 'lastName': 'Einstein',
'nameCollisionId': 0,
'openidUid': 'albert@einstein.id' 'openidUid': 'albert@einstein.id'
} }
} }
......
...@@ -19,6 +19,7 @@ snapshots['test_all 1'] = { ...@@ -19,6 +19,7 @@ snapshots['test_all 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 1 'totalReports': 1
}, },
'body': 'Another long story.', 'body': 'Another long story.',
...@@ -41,6 +42,7 @@ snapshots['test_all 1'] = { ...@@ -41,6 +42,7 @@ snapshots['test_all 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 2 'totalReports': 2
}, },
'body': 'Aragorn is the King. And we have lost the Ring.', 'body': 'Aragorn is the King. And we have lost the Ring.',
...@@ -63,6 +65,7 @@ snapshots['test_all 1'] = { ...@@ -63,6 +65,7 @@ snapshots['test_all 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 2 'totalReports': 2
}, },
'body': 'Long story short: we got the Ring!', 'body': 'Long story short: we got the Ring!',
...@@ -101,6 +104,7 @@ snapshots['test_query 1'] = { ...@@ -101,6 +104,7 @@ snapshots['test_query 1'] = {
'firstName': 'Spongebob', 'firstName': 'Spongebob',
'id': 'QXV0aG9yOjI=', 'id': 'QXV0aG9yOjI=',
'lastName': 'Squarepants', 'lastName': 'Squarepants',
'nameCollisionId': 0,
'totalReports': 1 'totalReports': 1
}, },
'body': 'Another long story.', 'body': 'Another long story.',
...@@ -133,6 +137,7 @@ snapshots['test_highlight 1'] = { ...@@ -133,6 +137,7 @@ snapshots['test_highlight 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 2 'totalReports': 2
}, },
'body': 'Aragorn is the King. And we have lost the <mark>Ring</mark>.', 'body': 'Aragorn is the King. And we have lost the <mark>Ring</mark>.',
...@@ -155,6 +160,7 @@ snapshots['test_highlight 1'] = { ...@@ -155,6 +160,7 @@ snapshots['test_highlight 1'] = {
'firstName': 'Winston', 'firstName': 'Winston',
'id': 'QXV0aG9yOjE=', 'id': 'QXV0aG9yOjE=',
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'totalReports': 2 'totalReports': 2
}, },
'body': 'Long story short: we got the <mark>Ring</mark>!', 'body': 'Long story short: we got the <mark>Ring</mark>!',
......
...@@ -22,6 +22,7 @@ snapshots['test_authenticated 1'] = { ...@@ -22,6 +22,7 @@ snapshots['test_authenticated 1'] = {
'id': 'VXNlcjox', 'id': 'VXNlcjox',
'isAuthor': True, 'isAuthor': True,
'lastName': 'Wolfe', 'lastName': 'Wolfe',
'nameCollisionId': 0,
'openidUid': 'TheWolf' 'openidUid': 'TheWolf'
} }
} }
......
...@@ -21,6 +21,7 @@ def test_all(client, snapshot): ...@@ -21,6 +21,7 @@ def test_all(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -49,6 +50,7 @@ def test_first(client, snapshot): ...@@ -49,6 +50,7 @@ def test_first(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -77,6 +79,7 @@ def test_first_after(client, snapshot): ...@@ -77,6 +79,7 @@ def test_first_after(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -105,6 +108,7 @@ def test_last(client, snapshot): ...@@ -105,6 +108,7 @@ def test_last(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -133,6 +137,7 @@ def test_last_before(client, snapshot): ...@@ -133,6 +137,7 @@ def test_last_before(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -159,6 +164,7 @@ def test_with_reports(client, snapshot): ...@@ -159,6 +164,7 @@ def test_with_reports(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
reports { reports {
......
...@@ -41,6 +41,7 @@ def test_author(client, snapshot): ...@@ -41,6 +41,7 @@ def test_author(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
}} }}
...@@ -84,6 +85,7 @@ def test_report(client, snapshot): ...@@ -84,6 +85,7 @@ def test_report(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
}} }}
...@@ -104,6 +106,7 @@ def test_user__unauthorized(client, snapshot): ...@@ -104,6 +106,7 @@ def test_user__unauthorized(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
openidUid openidUid
isAuthor isAuthor
extra extra
...@@ -127,6 +130,7 @@ def test_user__not_a_viewer(client, snapshot): ...@@ -127,6 +130,7 @@ def test_user__not_a_viewer(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
openidUid openidUid
isAuthor isAuthor
extra extra
...@@ -148,6 +152,7 @@ def test_user(client, snapshot): ...@@ -148,6 +152,7 @@ def test_user(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
openidUid openidUid
isAuthor isAuthor
extra extra
......
...@@ -29,6 +29,7 @@ def test_all(client, snapshot): ...@@ -29,6 +29,7 @@ def test_all(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -69,6 +70,7 @@ def test_query(client, snapshot): ...@@ -69,6 +70,7 @@ def test_query(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
...@@ -103,6 +105,7 @@ def test_highlight(client, snapshot): ...@@ -103,6 +105,7 @@ def test_highlight(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
totalReports totalReports
extra extra
} }
......
...@@ -34,6 +34,7 @@ def test_authenticated(client, snapshot): ...@@ -34,6 +34,7 @@ def test_authenticated(client, snapshot):
id id
firstName firstName
lastName lastName
nameCollisionId
email email
openidUid openidUid
isAuthor isAuthor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment