From fb900d58cdeb866290d4804a49903c9a27638358 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 3 Apr 2021 12:38:12 -0700 Subject: [PATCH] Names status urls --- bookwyrm/urls.py | 26 ++++++++++++++++++++------ bookwyrm/views/status.py | 4 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 8e583a58..828d46bf 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -197,12 +197,26 @@ urlpatterns = [ re_path(r"^block/(?P\d+)/?$", views.Block.as_view()), re_path(r"^unblock/(?P\d+)/?$", views.unblock), # statuses - re_path(r"%s(.json)?/?$" % status_path, views.Status.as_view()), - re_path(r"%s/activity/?$" % status_path, views.Status.as_view()), - re_path(r"%s/replies(.json)?/?$" % status_path, views.Replies.as_view()), - re_path(r"^post/(?P\w+)/?$", views.CreateStatus.as_view()), - re_path(r"^delete-status/(?P\d+)/?$", views.DeleteStatus.as_view()), - re_path(r"^redraft-status/(?P\d+)/?$", views.DeleteAndRedraft.as_view()), + re_path(r"%s(.json)?/?$" % status_path, views.Status.as_view(), name="status"), + re_path(r"%s/activity/?$" % status_path, views.Status.as_view(), name="status"), + re_path( + r"%s/replies(.json)?/?$" % status_path, views.Replies.as_view(), name="replies" + ), + re_path( + r"^post/(?P\w+)/?$", + views.CreateStatus.as_view(), + name="create-status", + ), + re_path( + r"^delete-status/(?P\d+)/?$", + views.DeleteStatus.as_view(), + name="delete-status", + ), + re_path( + r"^redraft-status/(?P\d+)/?$", + views.DeleteAndRedraft.as_view(), + name="redraft", + ), # interact re_path(r"^favorite/(?P\d+)/?$", views.Favorite.as_view()), re_path(r"^unfavorite/(?P\d+)/?$", views.Unfavorite.as_view()), diff --git a/bookwyrm/views/status.py b/bookwyrm/views/status.py index f86dc49d..b68b7339 100644 --- a/bookwyrm/views/status.py +++ b/bookwyrm/views/status.py @@ -109,8 +109,8 @@ class DeleteAndRedraft(View): status.delete() data = feed_page_data(request.user) # TODO: set up the correct edit state - data['redraft_form'] = redraft_form - return TemplateResponse(request, 'feed/feed.html') + data["redraft_form"] = redraft_form + return TemplateResponse(request, "feed/feed.html") def find_mentions(content):