Merged in [13501] from rjsparks@nostrum.com:

Use a simpler widget for the public key file when editing a nomcom to remove confusion between clearing keys and clearing the form control. Fixes #2299.
 - Legacy-Id: 13519
Note: SVN reference [13501] has been migrated to Git commit ca76f5c8f0fbf0832440680381380995b0092ea7
This commit is contained in:
Henrik Levkowetz 2017-06-04 19:40:26 +00:00
parent 2bacdd3a00
commit d041edf1b3

View file

@ -6,6 +6,7 @@ from django.utils.decorators import method_decorator
from django.shortcuts import render
from django.urls import reverse
from django.utils.html import mark_safe
from django.forms.widgets import FileInput
from ietf.dbtemplate.forms import DBTemplateForm
from ietf.group.models import Group, Role
@ -205,13 +206,14 @@ class EditNomcomForm(forms.ModelForm):
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"
help_text = "The nomcom does not have a public key yet"
self.fields['public_key'].help_text = help_text
class Meta:
model = NomCom
fields = ('public_key', 'initial_text', 'show_nominee_pictures',
'send_questionnaire', 'reminder_interval')
widgets = {'public_key':FileInput, }
def clean_public_key(self):
public_key = self.cleaned_data.get('public_key', None)