Merge pull request #2119 from bookwyrm-social/edit-book

Fixes urls in edit book form
This commit is contained in:
Mouse Reeve 2022-05-19 10:47:10 -07:00 committed by GitHub
commit 065095776f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View file

@ -41,10 +41,18 @@
class="block"
{% if book.id %}
name="edit-book"
action="{{ book.local_path }}/{% if confirm_mode %}confirm{% else %}edit{% endif %}"
{% if confirm_mode %}
action="{% url 'edit-book-confirm' book.id %}"
{% else %}
action="{% url 'edit-book' book.id %}"
{% endif %}
{% else %}
name="create-book"
action="/create-book{% if confirm_mode %}/confirm{% endif %}"
{% if confirm_mode %}
action="{% url 'create-book-confirm' %}"
{% else %}
action="{% url 'create-book' %}"
{% endif %}
{% endif %}
method="post"
enctype="multipart/form-data"

View file

@ -537,12 +537,20 @@ urlpatterns = [
name="book-user-statuses",
),
re_path(rf"{BOOK_PATH}/edit/?$", views.EditBook.as_view(), name="edit-book"),
re_path(rf"{BOOK_PATH}/confirm/?$", views.ConfirmEditBook.as_view()),
re_path(
rf"{BOOK_PATH}/confirm/?$",
views.ConfirmEditBook.as_view(),
name="edit-book-confirm",
),
re_path(
r"^create-book/data/?$", views.create_book_from_data, name="create-book-data"
),
re_path(r"^create-book/?$", views.CreateBook.as_view(), name="create-book"),
re_path(r"^create-book/confirm/?$", views.ConfirmEditBook.as_view()),
re_path(
r"^create-book/confirm/?$",
views.ConfirmEditBook.as_view(),
name="create-book-confirm",
),
re_path(rf"{BOOK_PATH}/editions(.json)?/?$", views.Editions.as_view()),
re_path(
r"^upload-cover/(?P<book_id>\d+)/?$", views.upload_cover, name="upload-cover"