it turns out that offer editing didn't quite work
parent
482d9be31d
commit
e72f55f919
|
@ -407,10 +407,10 @@ class OfferForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Offer
|
||||
fields = 'work', 'price', 'license'
|
||||
widgets = {
|
||||
'work': forms.HiddenInput,
|
||||
'license': forms.HiddenInput,
|
||||
'active': forms.HiddenInput,
|
||||
}
|
||||
|
||||
date_selector=range(date.today().year, settings.MAX_CC_DATE.year+1)
|
||||
|
|
|
@ -395,7 +395,11 @@ Please fix the following before launching your campaign:
|
|||
{{ offer.offer_form.active }}
|
||||
{{ offer.offer_form.license }}
|
||||
{{ offer.offer_form.work }}</span>
|
||||
{% if offer.active %}
|
||||
<input type="submit" name="change_offer" value="Change Price" />
|
||||
{% else %}
|
||||
<input type="submit" name="change_offer" value="Set Offer" /> <span class="yikes"><i>This offer is not active</a>
|
||||
{% endif %}
|
||||
</div></form>
|
||||
<p />
|
||||
{% endfor %}
|
||||
|
|
|
@ -665,6 +665,8 @@ def manage_campaign(request, id, action='manage'):
|
|||
offer.offer_form=OfferForm(instance=offer, data = request.POST, prefix='offer_%d'%offer.id)
|
||||
if offer.offer_form.is_valid():
|
||||
offer.offer_form.save()
|
||||
offer.active = True
|
||||
offer.save()
|
||||
alerts.append(_('Offer has been changed'))
|
||||
else:
|
||||
alerts.append(_('Offer has not been changed'))
|
||||
|
|
Loading…
Reference in New Issue