mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
Actually fix ensure_transient_values_persist call
oops
This commit is contained in:
parent
6f025af99f
commit
5f5886edea
1 changed files with 4 additions and 3 deletions
|
@ -143,10 +143,11 @@ class CreateBook(View):
|
||||||
|
|
||||||
def ensure_transient_values_persist(request, data, **kwargs):
|
def ensure_transient_values_persist(request, data, **kwargs):
|
||||||
"""ensure that values of transient form fields persist when re-rendering the form"""
|
"""ensure that values of transient form fields persist when re-rendering the form"""
|
||||||
data["book"] = data.get("book") or {}
|
|
||||||
data["book"]["subjects"] = kwargs["form"].cleaned_data["subjects"]
|
|
||||||
data["add_author"] = request.POST.getlist("add_author")
|
|
||||||
data["cover_url"] = request.POST.get("cover-url")
|
data["cover_url"] = request.POST.get("cover-url")
|
||||||
|
if kwargs and kwargs.get("form"):
|
||||||
|
data["book"] = data.get("book") or {}
|
||||||
|
data["book"]["subjects"] = kwargs["form"].cleaned_data["subjects"]
|
||||||
|
data["add_author"] = request.POST.getlist("add_author")
|
||||||
|
|
||||||
|
|
||||||
def add_authors(request, data):
|
def add_authors(request, data):
|
||||||
|
|
Loading…
Reference in a new issue