Skip to content

Commit

Permalink
Use a simpler widget for the public key file when editing a nomcom to…
Browse files Browse the repository at this point in the history
… remove confusion between clearing keys and clearing the form control. Fixes #2299. Commit ready for merge.

 - Legacy-Id: 13501
  • Loading branch information
rjsparks committed Jun 2, 2017
1 parent e422717 commit ca76f5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ietf/nomcom/forms.py
Expand Up @@ -6,6 +6,7 @@
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
Expand Down Expand Up @@ -205,13 +206,14 @@ def __init__(self, *args, **kwargs):
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)
Expand Down

0 comments on commit ca76f5c

Please sign in to comment.