Example #1
0
 def clean_title(self):
     title = self.cleaned_data['title']
     if Manager.objects.filter(title=title).count() and Manager.objects.get(title=title) != self.instance:
         raise forms.ValidationError("A manager with this title already exists.")
     if not verify_url(title):
         raise forms.ValidationError("Invalid title. Must be characters A-Z, a-z, 0-9, space, or _&-'?$^%@!#*()=+;:|/.,")
     url_title = convert_to_url(title)
     if Manager.objects.filter(url_title=url_title).count() and Manager.objects.get(url_title=url_title) != self.instance:
         raise forms.ValidationError('This manager title maps to a url that is already taken.  Please note, "Site Admin" and "sITe_adMIN" map to the same URL.')
     return title
Example #2
0
 def clean_title(self):
     title = self.cleaned_data['title']
     if Manager.objects.filter(title=title).count() and Manager.objects.get(title=title) != self.instance:
         raise forms.ValidationError("A manager with this title already exists.")
     if not verify_url(title):
         raise forms.ValidationError("Invalid title. Must be characters A-Z, a-z, 0-9, space, or _&-'?$^%@!#*()=+;:|/.,")
     url_title = convert_to_url(title)
     if Manager.objects.filter(url_title=url_title).count() and Manager.objects.get(url_title=url_title) != self.instance:
         raise forms.ValidationError('This manager title maps to a url that is already taken.  Please note, "Site Admin" and "sITe_adMIN" map to the same URL.')
     return title
Example #3
0
 def clean_name(self):
     name = self.cleaned_data['name']
     if not verify_url(name):
         raise forms.ValidationError("Invalid name. Must be characters A-Z, a-z, 0-9, space, or _&-'?$^%@!#*()=+;:|/.,")
     if RequestType.objects.filter(name=name).count() and \
       RequestType.objects.get(name=name) != self.instance:
         raise forms.ValidationError("A request type with this name already exists.")
     url_name = convert_to_url(name)
     if RequestType.objects.filter(url_name=url_name).count() and \
       RequestType.objects.get(url_name=url_name) != self.instance:
         raise forms.ValidationError('This request type name maps to a url that is already taken.  Please note, "Waste Reduction" and "wasTE_RedUCtiON" map to the same URL.')
     return name
Example #4
0
 def clean_name(self):
     name = self.cleaned_data['name']
     if not verify_url(name):
         raise forms.ValidationError("Invalid name. Must be characters A-Z, a-z, 0-9, space, or _&-'?$^%@!#*()=+;:|/.,")
     if RequestType.objects.filter(name=name).count() and \
       RequestType.objects.get(name=name) != self.instance:
         raise forms.ValidationError("A request type with this name already exists.")
     url_name = convert_to_url(name)
     if RequestType.objects.filter(url_name=url_name).count() and \
       RequestType.objects.get(url_name=url_name) != self.instance:
         raise forms.ValidationError('This request type name maps to a url that is already taken.  Please note, "Waste Reduction" and "wasTE_RedUCtiON" map to the same URL.')
     return name