From 3feb1d2114e6c3f11a881a26bb55de345542edf6 Mon Sep 17 00:00:00 2001 From: Longze Chen Date: Fri, 10 Jan 2025 13:12:09 -0500 Subject: [PATCH] Fix ClaimUser view to support versioned preprint --- api/users/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/users/views.py b/api/users/views.py index f3bbfc172cf..f67babc667e 100644 --- a/api/users/views.py +++ b/api/users/views.py @@ -797,9 +797,8 @@ def post(self, request, *args, **kwargs): if claimed_user.is_disabled: raise ValidationError('Cannot claim disabled account.') - try: - record_referent = Guid.objects.get(_id=record_id).referent - except Guid.DoesNotExist: + record_referent, _ = Guid.load_referent(record_id) + if not record_referent: raise NotFound('Unable to find specified record.') try: