Skip to content

Commit

Permalink
update _id cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostap-Zherebetskyi committed Jan 7, 2025
1 parent 42e7907 commit b8c9804
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions osf/models/preprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ def create(cls, provider, title, creator, description):
)
versioned_guid.save()

preprint._id = None # trigger _id cache update

return preprint

def get_last_not_rejected_version(self):
Expand Down Expand Up @@ -426,8 +424,6 @@ def create_version(cls, create_from_guid, auth):
)
guid_version.save()

preprint._id = None # trigger _id cache update

# Add contributors
for contributor_info in latest_version.contributor_set.exclude(user=latest_version.creator).values('visible', 'user_id', '_order'):
preprint.contributor_set.create(**{**contributor_info, 'preprint_id': preprint.id})
Expand All @@ -442,7 +438,6 @@ def create_version(cls, create_from_guid, auth):
guid_obj.object_id = preprint.pk
guid_obj.content_type = ContentType.objects.get_for_model(preprint)
guid_obj.save()
preprint._id = None # trigger _id cache update

return preprint, data_to_update

Expand Down
1 change: 0 additions & 1 deletion osf_tests/management_commands/test_check_crossref_dois.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def stuck_preprint(self):
guid._id = 'guid0'
guid.save()

preprint._id = None
preprint.save()
return preprint

Expand Down
1 change: 0 additions & 1 deletion osf_tests/test_guid.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,5 @@ def test_versioned_preprint_id_property(self, creator, preprint_provider):
assert preprint._id == expected_guid

GuidVersionsThrough.objects.filter(guid=preprint_guid).delete()
preprint._id = None

assert preprint._id is None

0 comments on commit b8c9804

Please sign in to comment.