##// END OF EJS Templates
fix required repo_type param on repo edit form
marcink -
r3863:794e6eaa beta
parent child Browse files
Show More
@@ -253,11 +253,15 b' class ReposController(BaseRepoController'
253 choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name)
253 choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name)
254 c.landing_revs_choices = choices
254 c.landing_revs_choices = choices
255 repo = Repository.get_by_repo_name(repo_name)
255 repo = Repository.get_by_repo_name(repo_name)
256 _form = RepoForm(edit=True, old_data={'repo_name': repo_name,
256 old_data = {
257 'repo_group': repo.group.get_dict() \
257 'repo_name': repo_name,
258 if repo.group else {}},
258 'repo_group': repo.group.get_dict() if repo.group else {},
259 'repo_type': repo.repo_type,
260 }
261 _form = RepoForm(edit=True, old_data=old_data,
259 repo_groups=c.repo_groups_choices,
262 repo_groups=c.repo_groups_choices,
260 landing_revs=c.landing_revs_choices)()
263 landing_revs=c.landing_revs_choices)()
264
261 try:
265 try:
262 form_result = _form.to_python(dict(request.POST))
266 form_result = _form.to_python(dict(request.POST))
263 repo = repo_model.update(repo_name, **form_result)
267 repo = repo_model.update(repo_name, **form_result)
@@ -182,7 +182,8 b' def RepoForm(edit=False, old_data={}, su'
182 v.SlugifyName())
182 v.SlugifyName())
183 repo_group = All(v.CanWriteGroup(old_data),
183 repo_group = All(v.CanWriteGroup(old_data),
184 v.OneOf(repo_groups, hideList=True))
184 v.OneOf(repo_groups, hideList=True))
185 repo_type = v.OneOf(supported_backends)
185 repo_type = v.OneOf(supported_backends, required=False,
186 if_missing=old_data.get('repo_type'))
186 repo_description = v.UnicodeString(strip=True, min=1, not_empty=False)
187 repo_description = v.UnicodeString(strip=True, min=1, not_empty=False)
187 repo_private = v.StringBoolean(if_missing=False)
188 repo_private = v.StringBoolean(if_missing=False)
188 repo_landing_rev = v.OneOf(landing_revs, hideList=True)
189 repo_landing_rev = v.OneOf(landing_revs, hideList=True)
General Comments 0
You need to be logged in to leave comments. Login now