forked from mirrors/bookwyrm
Fixes bug around unset absolute ids
This commit is contained in:
parent
380e49712d
commit
db6af61f03
1 changed files with 2 additions and 0 deletions
|
@ -114,6 +114,8 @@ def get_favorite(absolute_id):
|
|||
def get_by_absolute_id(absolute_id, model):
|
||||
''' generalized function to get from a model with a remote_id field '''
|
||||
# check if it's a remote status
|
||||
if not absolute_id:
|
||||
return None
|
||||
try:
|
||||
return model.objects.get(remote_id=absolute_id)
|
||||
except model.DoesNotExist:
|
||||
|
|
Loading…
Reference in a new issue