Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for create-book #2937

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bookwyrm/forms/books.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class Meta:
model = models.Work
fields = [
"title",
"sort_title",
"subtitle",
"authors",
"description",
Expand Down
4 changes: 2 additions & 2 deletions bookwyrm/templates/book/edit/edit_book.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ <h2 class="title is-4">{% trans "Confirm Book Info" %}</h2>
{% endif %}
{% endfor %}
</div>
{% else %}
{% elif add_author %}
<p class="column is-half">{% blocktrans with name=add_author %}Creating a new author: {{ name }}{% endblocktrans %}</p>
{% endif %}

{% if not book %}
{% if not book.parent_work %}
<div class="column is-half">
<fieldset>
<legend class="title is-5 mb-1">
Expand Down
2 changes: 2 additions & 0 deletions bookwyrm/templates/book/edit/edit_book_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
{% csrf_token %}

<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">
{% if form.parent_work %}
<input type="hidden" name="parent_work" value="{% firstof book.parent_work.id form.parent_work %}">
{% endif %}

<div class="columns">
<div class="column is-half">
Expand Down
1 change: 1 addition & 0 deletions bookwyrm/templates/book/editions/editions.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ <h2 class="title is-5 mb-1">
<form action="{% url 'create-book-data' %}" method="POST" name="add-edition-form">
{% csrf_token %}
{{ work_form.title }}
{{ work_form.sort_title }}
{{ work_form.subtitle }}
{{ work_form.authors }}
{{ work_form.description }}
Expand Down
1 change: 1 addition & 0 deletions bookwyrm/views/books/edit_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def add_authors(request, data):
"""helper for adding authors"""
add_author = [author for author in request.POST.getlist("add_author") if author]
if not add_author:
data["add_author"] = []
return data

data["add_author"] = add_author
Expand Down