diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2012-06-15 00:05:20 +0200 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2012-06-15 00:05:20 +0200 |
commit | 56a8a2f270121f47dbac6cc1d0da10e7dabe0593 (patch) | |
tree | b5203ddb83b5e767e68813fed6fcbe7d95a9b31f /rhodecode/model/forms.py | |
parent | 0dc6affa3b12086cb0f05a2ff4939ab1967819d4 (diff) |
validating choices for landing_rev
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/forms.py')
-rw-r--r-- | rhodecode/model/forms.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py index edbd482c..18693b32 100644 --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -653,7 +653,7 @@ def PasswordResetForm(): def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), - repo_groups=[]): + repo_groups=[], landing_revs=[]): class _RepoForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False @@ -666,7 +666,7 @@ def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), private = StringBoolean(if_missing=False) enable_statistics = StringBoolean(if_missing=False) enable_downloads = StringBoolean(if_missing=False) - landing_rev = UnicodeString(strip=True, min=1, not_empty=True) + landing_rev = OneOf(landing_revs, hideList=True) if edit: #this is repo owner @@ -678,8 +678,8 @@ def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), return _RepoForm -def RepoForkForm(edit=False, old_data={}, - supported_backends=BACKENDS.keys(), repo_groups=[]): +def RepoForkForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), + repo_groups=[]): class _RepoForkForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False @@ -697,8 +697,8 @@ def RepoForkForm(edit=False, old_data={}, return _RepoForkForm -def RepoSettingsForm(edit=False, old_data={}, - supported_backends=BACKENDS.keys(), repo_groups=[]): +def RepoSettingsForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(), + repo_groups=[], landing_revs=[]): class _RepoForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False @@ -707,7 +707,7 @@ def RepoSettingsForm(edit=False, old_data={}, description = UnicodeString(strip=True, min=1, not_empty=True) repo_group = OneOf(repo_groups, hideList=True) private = StringBoolean(if_missing=False) - landing_rev = UnicodeString(strip=True, min=1, not_empty=True) + landing_rev = OneOf(landing_revs, hideList=True) chained_validators = [ValidRepoName(edit, old_data), ValidPerms(), ValidSettings] return _RepoForm |