forgot to set status in new_edition

pull/1/head
eric 2014-03-12 19:32:56 -04:00
parent 4109778855
commit b8409a815b
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<div class="clearfix">
{% if edition.ebook_form %}
{% ifnotequal status 'ACTIVE' %}
{% if show_ebook_form %}
<div id="add_ebook">
{% if edition.ebooks.all.0 %}
@ -25,7 +25,7 @@
</div>
{% else %}
<div> Uploads are disabled for this work.</div>
{% endifnotequal %}
{% endif %}
{% endif %}
</div>

View File

@ -616,9 +616,13 @@ def new_edition(request, work_id, edition_id, by=None):
if edition.pk:
edition.ebook_form = EbookForm( instance= models.Ebook(user = request.user, edition = edition, provider = 'x' ), prefix = 'ebook_%d'%edition.id)
form = EditionForm(instance=edition, initial=initial)
try:
show_ebook_form = edition.work.last_campaign().status not in ['ACTIVE','INITIALIZED']
except:
show_ebook_form = True
return render(request, 'new_edition.html', {
'form': form, 'edition': edition, 'admin':admin, 'alert':alert
'form': form, 'edition': edition, 'admin':admin, 'alert':alert,
'show_ebook_form':show_ebook_form,
})
def campaign_results(request, campaign):