diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 1d894eeeb..bc47bb602 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -47,7 +47,9 @@ urlpatterns = [ re_path(r"^ostatus_subscribe/?$", views.ostatus_follow_request), # polling updates re_path("^api/updates/notifications/?$", views.get_notification_count), - re_path("^api/updates/stream/(?P[a-z]+)/?$", views.get_unread_status_string), + re_path( + "^api/updates/stream/(?P[a-z]+)/?$", views.get_unread_status_string + ), # authentication re_path(r"^login/?$", views.Login.as_view(), name="login"), re_path(r"^login/(?Pconfirmed)/?$", views.Login.as_view(), name="login"), diff --git a/bookwyrm/views/updates.py b/bookwyrm/views/updates.py index 7c2574f3b..3c3dc6afb 100644 --- a/bookwyrm/views/updates.py +++ b/bookwyrm/views/updates.py @@ -33,14 +33,14 @@ def get_unread_status_string(request, stream="home"): allowed_status_types = request.user.feed_status_types count = sum(c for (k, c) in counts_by_type if k in allowed_status_types) # if "everything else" is allowed, add other types to the sum - count += sum(c for (k, c) in counts_by_type if k not in ["review", "comment", "quotation"]) + count += sum( + c + for (k, c) in counts_by_type + if k not in ["review", "comment", "quotation"] + ) translation_string = lambda c: ngettext( - "Load %(count)d unread status", - "Load %(count)d unread statuses", - c + "Load %(count)d unread status", "Load %(count)d unread statuses", c ) % {"count": c} - return JsonResponse( - {"total": translation_string(count)} - ) + return JsonResponse({"total": translation_string(count)})