@@ -134,31 +134,12 @@ def clean_name(self):
134134
135135 def save (self , force_insert = False , force_update = False , commit = True ):
136136 area = super (AddAreaModelForm , self ).save (commit = False )
137- area_type = GroupTypeName .objects .get (name = 'area' )
138- area .type = area_type
137+ area . type = GroupTypeName .objects .get (slug = 'area' )
138+ area .parent = Group . objects . get ( acronym = 'iesg' )
139139 if commit :
140140 area .save ()
141141 return area
142142
143- # class AddAreaForm(forms.Form):
144- # acronym = forms.CharField(max_length=16,required=True)
145- # name = forms.CharField(max_length=80,required=True)
146- # status = forms.IntegerField(widget=forms.Select(choices=STATE_CHOICES),required=True)
147- # start_date = forms.DateField()
148- # comments = forms.CharField(widget=forms.Textarea(attrs={'rows':'1'}),required=False, strip=False)
149- #
150- # def clean_acronym(self):
151- # # get name, strip leading and trailing spaces
152- # name = self.cleaned_data.get('acronym', '').strip()
153- # # check for invalid characters
154- # r1 = re.compile(r'[a-zA-Z\-\. ]+$')
155- # if name and not r1.match(name):
156- # raise forms.ValidationError("Enter a valid acronym (only letters,period,hyphen allowed)")
157- # # ensure doesn't already exist
158- # if Group.objects.filter(acronym=name).exists():
159- # raise forms.ValidationError("This acronym already exists. Enter a unique one.")
160- # return name
161-
162143class AreaDirectorForm (forms .Form ):
163144 ad_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." )
164145 #login = forms.EmailField(max_length=75,help_text="This should be the person's primary email address.")
0 commit comments