Fixes creating news works
This commit is contained in:
parent
a29d6a5f16
commit
965d84f86f
|
@ -60,7 +60,7 @@
|
||||||
{% for match in book_matches %}
|
{% for match in book_matches %}
|
||||||
<label class="label"><input type="radio" name="parent_work" value="{{ match.parent_work.id }}"> {{ match.parent_work.title }}</label>
|
<label class="label"><input type="radio" name="parent_work" value="{{ match.parent_work.id }}"> {{ match.parent_work.title }}</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<label><input type="radio" name="parent_work"> this is a new work</label>
|
<label><input type="radio" name="parent_work" value="0"> this is a new work</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -203,7 +203,7 @@ class ConfirmEditBook(View):
|
||||||
# create work, if needed
|
# create work, if needed
|
||||||
if not book_id:
|
if not book_id:
|
||||||
work_match = request.POST.get("parent_work")
|
work_match = request.POST.get("parent_work")
|
||||||
if work_match:
|
if work_match and work_match != "0":
|
||||||
work = get_object_or_404(models.Work, id=work_match)
|
work = get_object_or_404(models.Work, id=work_match)
|
||||||
else:
|
else:
|
||||||
work = models.Work.objects.create(title=form.cleaned_data["title"])
|
work = models.Work.objects.create(title=form.cleaned_data["title"])
|
||||||
|
|
Loading…
Reference in New Issue