app/soc/views/user/profile.py
changeset 249 325fb70c61a9
parent 245 b14c2c4d3484
child 256 101c586ff5c8
equal deleted inserted replaced
248:95e0b84e71c5 249:325fb70c61a9
    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 validate
    32 from soc.logic import out_of_band
    32 from soc.logic import out_of_band
    33 from soc.logic.site import id_user
    33 from soc.logic.site import id_user
    34 from soc.views import simple
    34 from soc.views import simple
    35 from soc.views.helpers import forms_helpers
    35 from soc.views.helpers import forms_helpers
    36 from soc.views.helpers import request_helpers
    36 from soc.views.helpers import request_helpers
    51     #: 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
    52     exclude = ['id', 'former_ids', 'is_developer', 'inheritance_line']
    52     exclude = ['id', 'former_ids', 'is_developer', 'inheritance_line']
    53   
    53   
    54   def clean_link_name(self):
    54   def clean_link_name(self):
    55     link_name = self.cleaned_data.get('link_name')
    55     link_name = self.cleaned_data.get('link_name')
    56     if not common.isLinkNameFormatValid(link_name):
    56     if not validate.isLinkNameFormatValid(link_name):
    57       raise forms.ValidationError("This link name is in wrong format.")
    57       raise forms.ValidationError("This link name is in wrong format.")
    58     elif not id_user.isLinkNameAvailableForId(link_name):
    58     elif not id_user.isLinkNameAvailableForId(link_name):
    59       raise forms.ValidationError("This link name is already in use.")
    59       raise forms.ValidationError("This link name is already in use.")
    60     return link_name
    60     return link_name
    61 
    61