diff --git a/partners/forms.py b/partners/forms.py index fd433f3def4a98afb0c216157585938353b16c85..37085e556580067a90e0793a79fcbf5c53d50e42 100644 --- a/partners/forms.py +++ b/partners/forms.py @@ -405,32 +405,6 @@ class PromoteToContactFormset(forms.BaseModelFormSet): This is a formset to process multiple `PromoteToContactForm`s at the same time designed for the 'promote prospect to partner' action. """ - def clean(self): - """ - Check if all CONTACT_TYPES are assigned to at least one contact. - """ - contact_type_keys = list(dict(CONTACT_TYPES).keys()) - for form in self.forms: - try: - contact_types = form.cleaned_data['contact_types'] - except KeyError: - # Form invalid for `contact_types` - continue - - for _type in contact_types: - try: - contact_type_keys.remove(_type) - except ValueError: - # Type-key already removed - continue - if not contact_type_keys: - break - if contact_type_keys: - # Add error to all forms if not all CONTACT_TYPES are assigned - for form in self.forms: - form.add_error('contact_types', ("Not all contact types have been" - " divided over the contacts yet.")) - def save(self, *args, **kwargs): raise DeprecationWarning(("This formset is not meant to used with the default" " `save` method. User the `promote_contacts` instead.")) diff --git a/partners/utils.py b/partners/utils.py index aade17e1d2c1dbfdd0aff7514143520f55946954..2289c704f047730a7924010c740f6f499277915c 100644 --- a/partners/utils.py +++ b/partners/utils.py @@ -1,7 +1,6 @@ from common.utils import BaseMailUtil - class PartnerUtils(BaseMailUtil): mail_sender = 'partners@scipost.org' mail_sender_title = 'SciPost Supporting Partners' @@ -14,8 +13,8 @@ class PartnerUtils(BaseMailUtil): and invite participation to the Supporting Partners Board. """ cls._send_mail(cls, 'email_prospartner_contact', - [cls._context['contact'].email,], - cls._context['email_subject']) + [cls._context['contact'].email], + cls._context['email_subject']) @classmethod def email_prospartner_generic(cls): @@ -24,5 +23,5 @@ class PartnerUtils(BaseMailUtil): for which no Contact could be defined. """ cls._send_mail(cls, 'email_prospartner_contact', - [cls._context['email'],], + [cls._context['email']], cls._context['email_subject'])