Skip to content

Commit b673c5f

Browse files
mkovaluaantkryt
authored andcommitted
[ENG-10309] Add meta to API preprint detail view to indicate spam status (CenterForOpenScience#11604)
* indicate if the preprint is spammy with meta: {flagged_content: true} * make sure that the sitemap doesn’t include any spammy preprint. * update generate sitemap test * get base get_meta in child meta to keep all needed meta data * exclude spam content for preprints sitemap * unify server response on getting specific registry/node/preprint if it is spammy to make it possible to create info page on front end * exclude spam from Nodes and Registrations on sitemap generation * avoid errors for objects where spam may not be determined * update code * show more specific message for spammy resource on contributor access {'flagged_content': True} to render specific UI to show contributor how to get support to ham the resource * implement unittests for spammy resource contributor access * refactor code * show if resource is spammed on retrieval to all types of user * add tests * ensure that the sitemap is working correctly for spammed content * Delete api_tests/preprints/views/test_preprint_detail_new_behaviors.py remove not needed test * raise Gone for deleted not spammed preprint to keep it same as for other deleted resources * change 404 to 410 for deleted preprints in tests * change 404 to 410 for deleted preprints in tests
1 parent 9803821 commit b673c5f

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

api/preprints/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ def get_preprint(self, check_object_permissions=True, ignore_404=False):
139139
sentry.log_message(f'Preprint deleted: [guid={base_guid_id}, version={preprint_version}]')
140140
raise Gone(detail='The requested preprint is no longer available.')
141141

142-
user = self.request.user
143142
if isinstance(user, AnonymousUser):
144143
user_is_reviewer = user_is_contributor = False
145144
else:

0 commit comments

Comments
 (0)