Merged in [14845] from rcross@amsl.com:
Remove unused roles/forms.py.
- Legacy-Id: 14859
Note: SVN reference [14845] has been migrated to Git commit 01bfbff170
This commit is contained in:
commit
a7b9c4b733
|
@ -1,45 +0,0 @@
|
|||
import re
|
||||
|
||||
from django import forms
|
||||
|
||||
|
||||
class LiaisonForm(forms.Form):
|
||||
liaison_name = forms.CharField(max_length=100,label='Name',help_text="To see a list of people type the first name, or last name, or both.")
|
||||
affiliation = forms.CharField(max_length=50)
|
||||
|
||||
# set css class=name-autocomplete for name field (to provide select list)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(LiaisonForm, self).__init__(*args, **kwargs)
|
||||
self.fields['liaison_name'].widget.attrs['class'] = 'name-autocomplete'
|
||||
|
||||
def clean_liaison_name(self):
|
||||
name = self.cleaned_data.get('liaison_name', '')
|
||||
# check for tag within parenthesis to ensure name was selected from the list
|
||||
m = re.search(r'(\d+)', name)
|
||||
if name and not m:
|
||||
raise forms.ValidationError("You must select an entry from the list!")
|
||||
return name
|
||||
|
||||
def clean_affiliation(self):
|
||||
affiliation = self.cleaned_data.get('affiliation', '')
|
||||
# give error if field ends with "Liaison", application adds this label
|
||||
m = re.search(r'[L|l]iaison$', affiliation)
|
||||
if affiliation and m:
|
||||
raise forms.ValidationError("Don't use 'Liaison' in field. Application adds this.")
|
||||
return affiliation
|
||||
|
||||
class ChairForm(forms.Form):
|
||||
chair_name = forms.CharField(max_length=100,label='Name',help_text="To see a list of people type the first name, or last name, or both.")
|
||||
|
||||
# set css class=name-autocomplete for name field (to provide select list)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ChairForm, self).__init__(*args, **kwargs)
|
||||
self.fields['chair_name'].widget.attrs['class'] = 'name-autocomplete'
|
||||
|
||||
def clean_chair_name(self):
|
||||
name = self.cleaned_data.get('chair_name', '')
|
||||
# check for tag within parenthesis to ensure name was selected from the list
|
||||
m = re.search(r'(\d+)', name)
|
||||
if name and not m:
|
||||
raise forms.ValidationError("You must select an entry from the list!")
|
||||
return name
|
|
@ -9,7 +9,6 @@ from ietf.ietfauth.utils import role_required
|
|||
from ietf.secr.groups.forms import RoleForm
|
||||
from ietf.secr.sreq.forms import GroupSelectForm
|
||||
|
||||
#from forms import *
|
||||
|
||||
# -------------------------------------------------
|
||||
# Helper Functions
|
||||
|
|
Loading…
Reference in a new issue