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:
parent
2bacdd3a00
commit
d041edf1b3
|
@ -6,6 +6,7 @@ from django.utils.decorators import method_decorator
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.html import mark_safe
|
from django.utils.html import mark_safe
|
||||||
|
from django.forms.widgets import FileInput
|
||||||
|
|
||||||
from ietf.dbtemplate.forms import DBTemplateForm
|
from ietf.dbtemplate.forms import DBTemplateForm
|
||||||
from ietf.group.models import Group, Role
|
from ietf.group.models import Group, Role
|
||||||
|
@ -205,13 +206,14 @@ class EditNomcomForm(forms.ModelForm):
|
||||||
if self.instance.public_key:
|
if self.instance.public_key:
|
||||||
help_text = "The nomcom already has a public key. Previous data will remain encrypted with the old key"
|
help_text = "The nomcom already has a public key. Previous data will remain encrypted with the old key"
|
||||||
else:
|
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
|
self.fields['public_key'].help_text = help_text
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = NomCom
|
model = NomCom
|
||||||
fields = ('public_key', 'initial_text', 'show_nominee_pictures',
|
fields = ('public_key', 'initial_text', 'show_nominee_pictures',
|
||||||
'send_questionnaire', 'reminder_interval')
|
'send_questionnaire', 'reminder_interval')
|
||||||
|
widgets = {'public_key':FileInput, }
|
||||||
|
|
||||||
def clean_public_key(self):
|
def clean_public_key(self):
|
||||||
public_key = self.cleaned_data.get('public_key', None)
|
public_key = self.cleaned_data.get('public_key', None)
|
||||||
|
|
Loading…
Reference in a new issue