Names status urls

This commit is contained in:
Mouse Reeve 2021-04-03 12:38:12 -07:00
parent 8711a2eba5
commit fb900d58cd
2 changed files with 22 additions and 8 deletions

View file

@ -197,12 +197,26 @@ urlpatterns = [
re_path(r"^block/(?P<user_id>\d+)/?$", views.Block.as_view()),
re_path(r"^unblock/(?P<user_id>\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<status_type>\w+)/?$", views.CreateStatus.as_view()),
re_path(r"^delete-status/(?P<status_id>\d+)/?$", views.DeleteStatus.as_view()),
re_path(r"^redraft-status/(?P<status_id>\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<status_type>\w+)/?$",
views.CreateStatus.as_view(),
name="create-status",
),
re_path(
r"^delete-status/(?P<status_id>\d+)/?$",
views.DeleteStatus.as_view(),
name="delete-status",
),
re_path(
r"^redraft-status/(?P<status_id>\d+)/?$",
views.DeleteAndRedraft.as_view(),
name="redraft",
),
# interact
re_path(r"^favorite/(?P<status_id>\d+)/?$", views.Favorite.as_view()),
re_path(r"^unfavorite/(?P<status_id>\d+)/?$", views.Unfavorite.as_view()),

View file

@ -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):