def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['email'].required = True
+ self.fields['email'].help_text = "Pick a confirmed email associated with the organisation. This will be used as the reply address of posted news. If no correct address is available, you need to register one on the <a href=\"/account/edit/organisations/\">organisation</a> before submitting."
def filter_by_user(self, user):
self.fields['org'].queryset = Organisation.objects.filter(managers=user, approved=True)
migrations.AddField(
model_name='newsarticle',
name='email',
- field=models.ForeignKey(blank=True, help_text='Pick a confirmed email associated with the organisation. This will be used as the reply address of posted news.', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.OrganisationEmail', verbose_name='Reply email'),
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.OrganisationEmail', verbose_name='Reply email'),
),
]
class NewsArticle(TwoModeratorsMixin, TristateModerateModel):
org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text=ORGANISATION_HINT_TEXT, on_delete=models.CASCADE)
- email = models.ForeignKey(OrganisationEmail, null=True, blank=True, verbose_name="Reply email", help_text="Pick a confirmed email associated with the organisation. This will be used as the reply address of posted news.", on_delete=models.PROTECT)
+ email = models.ForeignKey(OrganisationEmail, null=True, blank=True, verbose_name="Reply email", on_delete=models.PROTECT)
date = models.DateField(null=False, blank=False, default=date.today, db_index=True)
title = models.CharField(max_length=200, null=False, blank=False)
content = models.TextField(null=False, blank=False)