parent
454128b165
commit
f3b3a21ccb
|
@ -280,6 +280,16 @@ class EditNomcomForm(BaseNomcomForm, forms.ModelForm):
|
|||
fieldsets = [('Edit nomcom settings', ('public_key', 'initial_text',
|
||||
'send_questionnaire', 'reminder_interval'))]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(EditNomcomForm, self).__init__(*args, **kwargs)
|
||||
|
||||
if self.instance:
|
||||
if self.instance.public_key:
|
||||
help_text = "The nomcom already has a public key. Previous data will remain encrypted with the old key"
|
||||
else:
|
||||
help_text = "The nomcom has not a public key yet"
|
||||
self.fields['public_key'].help_text = help_text
|
||||
|
||||
class Meta:
|
||||
model = NomCom
|
||||
fields = ('public_key', 'initial_text',
|
||||
|
|
|
@ -440,8 +440,12 @@ def view_feedback_nominee(request, year, nominee_id):
|
|||
@member_required(role='chair')
|
||||
def edit_nomcom(request, year):
|
||||
nomcom = get_nomcom_by_year(year)
|
||||
has_publickey = nomcom.public_key and True or False
|
||||
|
||||
message = ('warning', 'Previous data will remain encrypted with the old key')
|
||||
if has_publickey:
|
||||
message = ('warning', 'Previous data will remain encrypted with the old key')
|
||||
else:
|
||||
message = ('warning', 'The nomcom has not a public key yet')
|
||||
|
||||
ReminderDateInlineFormSet = inlineformset_factory(parent_model=NomCom,
|
||||
model=ReminderDates,
|
||||
|
|
Loading…
Reference in a new issue