Merge pull request #1452 from bookwyrm-social/goal_path

Fixes goal url
This commit is contained in:
Mouse Reeve 2021-09-22 12:32:42 -07:00 committed by GitHub
commit 3e60098185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
{% load i18n %}
<form method="post" name="goal" action="{{ request.user.local_path }}/goal/{{ year }}">
<form method="post" name="goal" action="{% url 'user-goal' request.user.localname year %}">
{% csrf_token %}
<input type="hidden" name="year" value="{% if goal %}{{ goal.year }}{% else %}{{ year }}{% endif %}">
<input type="hidden" name="user" value="{{ request.user.id }}">

View file

@ -291,7 +291,7 @@ urlpatterns = [
re_path(r"^unshelve/?$", views.unshelve),
# goals
re_path(
rf"{USER_PATH}/goal/(?P<year>\d{4})/?$",
rf"{LOCAL_USER_PATH}/goal/(?P<year>\d+)/?$",
views.Goal.as_view(),
name="user-goal",
),