From 1789b091d6d08e5c9c56e04238d2a94ed5f1af72 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 28 Nov 2020 18:23:34 -0800 Subject: [PATCH] not all that better way to distinguish add book to shelf vs tag --- bookwyrm/incoming.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bookwyrm/incoming.py b/bookwyrm/incoming.py index e9b0d0190..1978e0fef 100644 --- a/bookwyrm/incoming.py +++ b/bookwyrm/incoming.py @@ -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