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
|
@app.task
|
||||||
def handle_add(activity):
|
def handle_add(activity):
|
||||||
''' putting a book on a shelf '''
|
''' putting a book on a shelf '''
|
||||||
# TODO absofuckinglutely not an acceptable solution
|
#this is janky as heck but I haven't thought of a better solution
|
||||||
if 'tag' in activity['id']:
|
try:
|
||||||
activitypub.AddBook(**activity).to_model(models.Tag)
|
|
||||||
else:
|
|
||||||
activitypub.AddBook(**activity).to_model(models.ShelfBook)
|
activitypub.AddBook(**activity).to_model(models.ShelfBook)
|
||||||
|
except activitypub.ActivitySerializerError:
|
||||||
|
activitypub.AddBook(**activity).to_model(models.Tag)
|
||||||
|
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
|
|
Loading…
Reference in a new issue