Show More
@@ -254,11 +254,15 b' class ReposController(BaseRepoController' | |||
|
254 | 254 | choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name) |
|
255 | 255 | c.landing_revs_choices = choices |
|
256 | 256 | repo = Repository.get_by_repo_name(repo_name) |
|
257 | _form = RepoForm(edit=True, old_data={'repo_name': repo_name, | |
|
258 | 'repo_group': repo.group.get_dict() \ | |
|
259 | if repo.group else {}}, | |
|
257 | old_data = { | |
|
258 | 'repo_name': repo_name, | |
|
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 | 263 | repo_groups=c.repo_groups_choices, |
|
261 | 264 | landing_revs=c.landing_revs_choices)() |
|
265 | ||
|
262 | 266 | try: |
|
263 | 267 | form_result = _form.to_python(dict(request.POST)) |
|
264 | 268 | repo = repo_model.update(repo_name, **form_result) |
@@ -184,7 +184,8 b' def RepoForm(edit=False, old_data={}, su' | |||
|
184 | 184 | v.SlugifyName()) |
|
185 | 185 | repo_group = All(v.CanWriteGroup(old_data), |
|
186 | 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 | 189 | repo_description = v.UnicodeString(strip=True, min=1, not_empty=False) |
|
189 | 190 | repo_private = v.StringBoolean(if_missing=False) |
|
190 | 191 | repo_landing_rev = v.OneOf(landing_revs, hideList=True) |
General Comments 0
You need to be logged in to leave comments.
Login now