mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 23:26:42 +00:00
not all that better way to distinguish add book to shelf vs tag
This commit is contained in:
parent
b4fe9f160f
commit
1789b091d6
1 changed files with 4 additions and 4 deletions
|
@ -293,11 +293,11 @@ def handle_unboost(activity):
|
|||
@app.task
|
||||
def handle_add(activity):
|
||||
''' putting a book on a shelf '''
|
||||
# TODO absofuckinglutely not an acceptable solution
|
||||
if 'tag' in activity['id']:
|
||||
activitypub.AddBook(**activity).to_model(models.Tag)
|
||||
else:
|
||||
#this is janky as heck but I haven't thought of a better solution
|
||||
try:
|
||||
activitypub.AddBook(**activity).to_model(models.ShelfBook)
|
||||
except activitypub.ActivitySerializerError:
|
||||
activitypub.AddBook(**activity).to_model(models.Tag)
|
||||
|
||||
|
||||
@app.task
|
||||
|
|
Loading…
Reference in a new issue