Skip to content

Commit

Permalink
bug fix for 55c8d9b
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Oct 16, 2023
1 parent 55c8d9b commit 66cf3bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,11 @@ def get_or_create(cls, id, actor=None, **props):
obj.new = False
orig_as1 = obj.as1
if orig_as1:
authors_actors = (as1.get_ids(orig_as1, 'author') +
as1.get_ids(orig_as1, 'actor'))
if not actor:
logger.warning(f'Cowardly refusing to overwrite {id} without checking actor')
elif actor not in (as1.get_ids(orig_as1, 'author') +
as1.get_ids(orig_as1, 'actor')):
elif actor not in authors_actors:
logger.warning(f"actor {actor} isn't {id}'s author or actor {authors_actors}")
else:
obj = Object(id=id)
Expand Down

0 comments on commit 66cf3bf

Please sign in to comment.