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')