diff --git a/openlobby/core/api/types.py b/openlobby/core/api/types.py index 50073c569a825bd21f3903a5ae4615041f3ef63f..c311f392e6c9430dfba276b79943d8d04cd789c2 100644 --- a/openlobby/core/api/types.py +++ b/openlobby/core/api/types.py @@ -87,7 +87,7 @@ class User(graphene.ObjectType): openid_uid = graphene.String() first_name = graphene.String() last_name = graphene.String() - name_collision_id = graphene.Int() + has_colliding_name = graphene.Boolean() email = graphene.String() is_author = graphene.Boolean() extra = JSONString() @@ -102,7 +102,7 @@ class User(graphene.ObjectType): openid_uid=user.openid_uid, first_name=user.first_name, last_name=user.last_name, - name_collision_id=user.name_collision_id, + has_colliding_name=user.has_colliding_name, email=user.email, is_author=user.is_author, extra=user.extra, @@ -120,7 +120,7 @@ class User(graphene.ObjectType): class Author(graphene.ObjectType): first_name = graphene.String() last_name = graphene.String() - name_collision_id = graphene.Int() + has_colliding_name = graphene.Boolean() total_reports = graphene.Int() extra = JSONString() reports = relay.ConnectionField(ReportConnection) @@ -134,7 +134,7 @@ class Author(graphene.ObjectType): id=user.id, first_name=user.first_name, last_name=user.last_name, - name_collision_id=user.name_collision_id, + has_colliding_name=user.has_colliding_name, extra=user.extra, total_reports=user.total_reports, ) diff --git a/tests/schema/snapshots/snap_test_authors.py b/tests/schema/snapshots/snap_test_authors.py index c8dcecbfdd1c4f9b0f3ee8e85c07cd5c2c61e5f8..b4ca426bc104b0c624bdd480b09ecc90f50b112c 100644 --- a/tests/schema/snapshots/snap_test_authors.py +++ b/tests/schema/snapshots/snap_test_authors.py @@ -16,9 +16,9 @@ snapshots['test_all 1'] = { 'node': { 'extra': None, 'firstName': 'Shaun', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjM=', 'lastName': 'Sheep', - 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -27,9 +27,9 @@ snapshots['test_all 1'] = { 'node': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -38,9 +38,9 @@ snapshots['test_all 1'] = { 'node': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 0 } } @@ -65,9 +65,9 @@ snapshots['test_first 1'] = { 'node': { 'extra': None, 'firstName': 'Shaun', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjM=', 'lastName': 'Sheep', - 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -76,9 +76,9 @@ snapshots['test_first 1'] = { 'node': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 0 } } @@ -103,9 +103,9 @@ snapshots['test_first_after 1'] = { 'node': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 0 } } @@ -147,9 +147,9 @@ snapshots['test_last_before 1'] = { 'node': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 0 } } @@ -173,9 +173,9 @@ snapshots['test_with_reports 1'] = { 'node': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'reports': { 'edges': [ { diff --git a/tests/schema/snapshots/snap_test_node.py b/tests/schema/snapshots/snap_test_node.py index b4cb9ab2ad87c53eec9a0d566cd989ecca68d215..9ebb2dc23c709bc983769899114a7273caa3fa7c 100644 --- a/tests/schema/snapshots/snap_test_node.py +++ b/tests/schema/snapshots/snap_test_node.py @@ -21,9 +21,9 @@ snapshots['test_author 1'] = { 'node': { 'extra': '{"x": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjU=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 0 } } @@ -41,9 +41,9 @@ snapshots['test_report 1'] = { 'author': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Long story short: we got the Ring!', @@ -77,10 +77,10 @@ snapshots['test_user 1'] = { 'node': { 'extra': '{"e": "mc2"}', 'firstName': 'Albert', + 'hasCollidingName': False, 'id': 'VXNlcjo4', 'isAuthor': False, 'lastName': 'Einstein', - 'nameCollisionId': 0, 'openidUid': 'albert@einstein.id' } } diff --git a/tests/schema/snapshots/snap_test_search_reports.py b/tests/schema/snapshots/snap_test_search_reports.py index ed5b20b795f1cb0bea7e14509c442283682e7e2a..27a214fee33dc664fc26b2b91594241638c9ed9f 100644 --- a/tests/schema/snapshots/snap_test_search_reports.py +++ b/tests/schema/snapshots/snap_test_search_reports.py @@ -17,9 +17,9 @@ snapshots['test_all 1'] = { 'author': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Another long story.', @@ -40,9 +40,9 @@ snapshots['test_all 1'] = { 'author': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Aragorn is the King. And we have lost the Ring.', @@ -63,9 +63,9 @@ snapshots['test_all 1'] = { 'author': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Long story short: we got the Ring!', @@ -102,9 +102,9 @@ snapshots['test_query 1'] = { 'author': { 'extra': None, 'firstName': 'Spongebob', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', - 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Another long story.', @@ -135,9 +135,9 @@ snapshots['test_highlight 1'] = { 'author': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Aragorn is the King. And we have lost the <mark>Ring</mark>.', @@ -158,9 +158,9 @@ snapshots['test_highlight 1'] = { 'author': { 'extra': '{"movies": 1}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Long story short: we got the <mark>Ring</mark>!', diff --git a/tests/schema/snapshots/snap_test_viewer.py b/tests/schema/snapshots/snap_test_viewer.py index 9a897fb14ebbdac06722ddaa5eaf2655920d700a..fb88edfc1557b7f419ab91d39a872731cc332863 100644 --- a/tests/schema/snapshots/snap_test_viewer.py +++ b/tests/schema/snapshots/snap_test_viewer.py @@ -19,10 +19,10 @@ snapshots['test_authenticated 1'] = { 'email': 'winston@wolfe.com', 'extra': '{"caliber": 45}', 'firstName': 'Winston', + 'hasCollidingName': False, 'id': 'VXNlcjox', 'isAuthor': True, 'lastName': 'Wolfe', - 'nameCollisionId': 0, 'openidUid': 'TheWolf' } } diff --git a/tests/schema/test_authors.py b/tests/schema/test_authors.py index 1547ec2103aa5a374539a816813bc3dc8723c440..afdf4fcd14b889a7650b857f2e071c386fc6bfe6 100644 --- a/tests/schema/test_authors.py +++ b/tests/schema/test_authors.py @@ -21,7 +21,7 @@ def test_all(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -50,7 +50,7 @@ def test_first(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -79,7 +79,7 @@ def test_first_after(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -108,7 +108,7 @@ def test_last(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -137,7 +137,7 @@ def test_last_before(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -164,7 +164,7 @@ def test_with_reports(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra reports { diff --git a/tests/schema/test_node.py b/tests/schema/test_node.py index d475d4c24cf9dd59bd4c2746c1721c1c3a02e01c..915b59d7ec77c29551ef4529a66e58a8fb80ceb7 100644 --- a/tests/schema/test_node.py +++ b/tests/schema/test_node.py @@ -41,7 +41,7 @@ def test_author(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra }} @@ -85,7 +85,7 @@ def test_report(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra }} @@ -106,7 +106,7 @@ def test_user__unauthorized(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName openidUid isAuthor extra @@ -130,7 +130,7 @@ def test_user__not_a_viewer(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName openidUid isAuthor extra @@ -152,7 +152,7 @@ def test_user(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName openidUid isAuthor extra diff --git a/tests/schema/test_search_reports.py b/tests/schema/test_search_reports.py index 2d2344a5f6aab82b09f836f5744297b44f10f555..f62bc2353fbafb877019764b37453cc82f72006c 100644 --- a/tests/schema/test_search_reports.py +++ b/tests/schema/test_search_reports.py @@ -29,7 +29,7 @@ def test_all(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -70,7 +70,7 @@ def test_query(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } @@ -105,7 +105,7 @@ def test_highlight(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName totalReports extra } diff --git a/tests/schema/test_viewer.py b/tests/schema/test_viewer.py index bf22119068d57603879e70d527a07fbf1748aeee..b5c08977d3d7af7d0942a4be4a44005cc112c851 100644 --- a/tests/schema/test_viewer.py +++ b/tests/schema/test_viewer.py @@ -34,7 +34,7 @@ def test_authenticated(client, snapshot): id firstName lastName - nameCollisionId + hasCollidingName email openidUid isAuthor