fixed issues with campaign setup [fix #27468285]

pull/1/head
eric 2012-04-07 14:12:54 -04:00
parent 74f749128b
commit e764a44ace
1 changed files with 5 additions and 2 deletions

View File

@ -805,16 +805,19 @@ def rh_tools(request):
if not claims:
return render(request, "rh_tools.html")
for claim in claims:
claim.campaigns= claim.work.campaigns.all()
if claim.status == 'active':
claim.campaigns = claim.work.campaigns.all()
else:
claim.campaigns = []
claim.can_open_new=True
for campaign in claim.campaigns:
if campaign.status in ['ACTIVE','INITIALIZED']:
claim.can_open_new=False
if campaign.status == 'ACTIVE':
if request.method == 'POST' and request.POST.has_key('edit_managers_%s'% campaign.id) :
campaign.edit_managers_form=EditManagersForm( instance=campaign, data=request.POST, prefix=campaign.id)
if campaign.edit_managers_form.is_valid():
campaign.edit_managers_form.save()
campaign.edit_managers_form = EditManagersForm(instance=campaign, prefix=campaign.id)
else:
campaign.edit_managers_form=EditManagersForm(instance=campaign, prefix=campaign.id)
if claim.status == 'active' and claim.can_open_new: