From 32a4b29e33d122434b9e4189605449d2d4cfaed4 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Tue, 8 May 2012 13:48:32 -0400 Subject: [PATCH] unrequiring paypal address --- core/models.py | 6 ++++++ frontend/forms.py | 1 + 2 files changed, 7 insertions(+) diff --git a/core/models.py b/core/models.py index ede7643f..716a1285 100755 --- a/core/models.py +++ b/core/models.py @@ -109,8 +109,14 @@ class Campaign(models.Model): left = models.DecimalField(max_digits=14, decimal_places=2, null=True, blank=False) deadline = models.DateTimeField() activated = models.DateTimeField(null=True) + + # setting blank=True ensures that these fields are not required + # in the widget generated in forms.py -- important while we are + # running two payment processors. Should we standardize on one + # and wish to enforce it for RHs, take out blank=True. paypal_receiver = models.CharField(max_length=100, blank=True) amazon_receiver = models.CharField(max_length=100, blank=True) + work = models.ForeignKey("Work", related_name="campaigns", null=False) managers = models.ManyToManyField(User, related_name="campaigns", null=False) # status: INITIALIZED, ACTIVE, SUSPENDED, WITHDRAWN, SUCCESSFUL, UNSUCCESSFUL diff --git a/frontend/forms.py b/frontend/forms.py index 4e337363..aa516a00 100644 --- a/frontend/forms.py +++ b/frontend/forms.py @@ -176,6 +176,7 @@ def getManageCampaignForm ( instance, data=None, *args, **kwargs ): label=_("email address to collect Paypal funds"), max_length=100, error_messages={'required': 'You must enter the email associated with your Paypal account.'}, + required = False, ) target = forms.DecimalField( min_value= D(settings.UNGLUEIT_MINIMUM_TARGET), error_messages={'required': 'Please specify a target price.'} ) edition = forms.ModelChoiceField(get_queryset(), widget=RadioSelect(),empty_label='no edition selected')