equal
deleted
inserted
replaced
17 """Views for Sponsor profiles. |
17 """Views for Sponsor profiles. |
18 """ |
18 """ |
19 |
19 |
20 __authors__ = [ |
20 __authors__ = [ |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
|
22 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
22 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
23 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
23 ] |
24 ] |
24 |
25 |
25 |
26 |
26 from google.appengine.api import users |
27 from google.appengine.api import users |
54 exclude = ['inheritance_line', 'author', 'created', 'modified'] |
55 exclude = ['inheritance_line', 'author', 'created', 'modified'] |
55 |
56 |
56 def clean_partial_path(self): |
57 def clean_partial_path(self): |
57 partial_path = self.cleaned_data.get('partial_path') |
58 partial_path = self.cleaned_data.get('partial_path') |
58 # TODO(tlarsen): combine path and link_name and check for uniqueness |
59 # TODO(tlarsen): combine path and link_name and check for uniqueness |
|
60 if not validate.isPartialPathFormatValid(partial_path): |
|
61 raise forms.ValidationError("This partial path is in wrong format.") |
59 return partial_path |
62 return partial_path |
60 |
63 |
61 def clean_link_name(self): |
64 def clean_link_name(self): |
62 link_name = self.cleaned_data.get('link_name') |
65 link_name = self.cleaned_data.get('link_name') |
63 # TODO(tlarsen): combine path and link_name and check for uniqueness |
66 # TODO(tlarsen): combine path and link_name and check for uniqueness |
|
67 if not validate.isLinkNameFormatValid(link_name): |
|
68 raise forms.ValidationError("This link name is in wrong format.") |
64 return link_name |
69 return link_name |
65 |
70 |
66 |
71 |
67 class EditForm(CreateForm): |
72 class EditForm(CreateForm): |
68 """Django form displayed a Document is edited. |
73 """Django form displayed a Document is edited. |