Mercurial > kallithea
comparison rhodecode/model/forms.py @ 3629:802c94bdfc85 beta
#749 and #516 Removed dupliciting of repo settings for rhodecode admins and repo admins
- repo admin now is allowed the same set of operations as the rhodecode admin
- single logic for forms/validations/permissions
- fixes #805 update external repo via webinterface
-
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 28 Mar 2013 02:57:05 +0100 |
parents | c734686b3cf2 |
children | ff2ea58debb5 |
comparison
equal
deleted
inserted
replaced
3628:c734686b3cf2 | 3629:802c94bdfc85 |
---|---|
225 new_field_desc = v.UnicodeString(not_empty=False) | 225 new_field_desc = v.UnicodeString(not_empty=False) |
226 | 226 |
227 return _RepoFieldForm | 227 return _RepoFieldForm |
228 | 228 |
229 | 229 |
230 def RepoSettingsForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), | |
231 repo_groups=[], landing_revs=[]): | |
232 class _RepoForm(formencode.Schema): | |
233 allow_extra_fields = True | |
234 filter_extra_fields = False | |
235 repo_name = All(v.UnicodeString(strip=True, min=1, not_empty=True), | |
236 v.SlugifyName()) | |
237 repo_group = All(v.CanWriteGroup(old_data), | |
238 v.OneOf(repo_groups, hideList=True)) | |
239 repo_description = v.UnicodeString(strip=True, min=1, not_empty=False) | |
240 repo_private = v.StringBoolean(if_missing=False) | |
241 repo_landing_rev = v.OneOf(landing_revs, hideList=True) | |
242 clone_uri = All(v.UnicodeString(strip=True, min=1, not_empty=False)) | |
243 | |
244 chained_validators = [v.ValidCloneUri(), | |
245 v.ValidRepoName(edit, old_data), | |
246 v.ValidPerms(), | |
247 v.ValidSettings()] | |
248 return _RepoForm | |
249 | |
250 | |
251 def RepoForkForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), | 230 def RepoForkForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), |
252 repo_groups=[], landing_revs=[]): | 231 repo_groups=[], landing_revs=[]): |
253 class _RepoForkForm(formencode.Schema): | 232 class _RepoForkForm(formencode.Schema): |
254 allow_extra_fields = True | 233 allow_extra_fields = True |
255 filter_extra_fields = False | 234 filter_extra_fields = False |