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