diff --git a/preferences/migrations/0063_mandate.py b/preferences/migrations/0063_mandate.py index 7f5dcf8b..16e52b29 100644 --- a/preferences/migrations/0063_mandate.py +++ b/preferences/migrations/0063_mandate.py @@ -13,7 +13,8 @@ def create_current_mandate(apps, schema_editor): AssoOption = apps.get_model('preferences', 'AssoOption') Mandate = apps.get_model('preferences', 'Mandate') Adherent = apps.get_model('users', 'Adherent') - pres_name = AssoOption.objects.get_or_create()[0].pres_name + assooption = AssoOption.objects.get_or_create()[0] + pres_name = assooption.pres_name l = pres_name.split(' ') try: name, surname = l[0], l[1] @@ -23,7 +24,11 @@ def create_current_mandate(apps, schema_editor): start_date=timezone.now(), ) except Exception as e: - print("Warning : I was unable to find an adherent corresponding to %s. You might want to edit your preferences afterward." % pres_name) + print("Warning : I was unable to find an adherent corresponding to %s. You might want to edit your preferences afterward. I will disable the sending of vouchers by email." % pres_name) + CotisationsOption = apps.get_model('preferences', 'CotisationsOption') + cotisoption = CotisationsOption.objects.get_or_create()[0] + cotisoption.send_voucher_mail = False + cotisoption.save() @@ -56,4 +61,8 @@ class Migration(migrations.Migration): name='send_voucher_mail', field=models.BooleanField(default=False, help_text='Be carefull, if no mandate is defined on the preferences page, errors will be triggered when generating vouchers.', verbose_name='Send voucher by email when the invoice is controlled.'), ), + migrations.RemoveField( + model_name='assooption', + name='pres_name', + ), ] diff --git a/preferences/models.py b/preferences/models.py index eb904148..0473ef9d 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -573,12 +573,6 @@ class AssoOption(AclMixin, PreferencesModel): null=True, blank=True, ) - pres_name = models.CharField( - max_length=255, - default="", - verbose_name=_("President of the association"), - help_text=_("Displayed on subscription vouchers") - ) class Meta: permissions = ( diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index a94c2c11..ff186f11 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -325,10 +325,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% trans "Description of the organisation" %} {{ assooptions.description|safe }} - - {% trans "President of the association"%} - {{ assooptions.pres_name }} -
{% trans "Mandates" %}
{% can_create Mandate %}