equal
deleted
inserted
replaced
26 from django import http |
26 from django import http |
27 from django import shortcuts |
27 from django import shortcuts |
28 from django import newforms as forms |
28 from django import newforms as forms |
29 from django.utils.translation import ugettext_lazy |
29 from django.utils.translation import ugettext_lazy |
30 |
30 |
|
31 from soc.logic import common |
31 from soc.logic import out_of_band |
32 from soc.logic import out_of_band |
32 from soc.logic.site import id_user |
33 from soc.logic.site import id_user |
33 from soc.views import simple |
34 from soc.views import simple |
34 from soc.views.helpers import forms_helpers |
35 from soc.views.helpers import forms_helpers |
35 from soc.views.helpers import request_helpers |
36 from soc.views.helpers import request_helpers |
50 #: list of model fields which will *not* be gathered by the form |
51 #: list of model fields which will *not* be gathered by the form |
51 exclude = ['id', 'former_ids', 'is_developer', 'inheritance_line'] |
52 exclude = ['id', 'former_ids', 'is_developer', 'inheritance_line'] |
52 |
53 |
53 def clean_link_name(self): |
54 def clean_link_name(self): |
54 link_name = self.cleaned_data.get('link_name') |
55 link_name = self.cleaned_data.get('link_name') |
55 if not id_user.isLinkNameFormatValid(link_name): |
56 if not common.isLinkNameFormatValid(link_name): |
56 raise forms.ValidationError("This link name is in wrong format.") |
57 raise forms.ValidationError("This link name is in wrong format.") |
57 elif not id_user.isLinkNameAvailableForId(link_name): |
58 elif not id_user.isLinkNameAvailableForId(link_name): |
58 raise forms.ValidationError("This link name is already in use.") |
59 raise forms.ValidationError("This link name is already in use.") |
59 return link_name |
60 return link_name |
60 |
61 |