Show More
@@ -265,8 +265,17 b' class ReposController(BaseController):' | |||||
265 | """GET /repos/repo_name/edit: Form to edit an existing item""" |
|
265 | """GET /repos/repo_name/edit: Form to edit an existing item""" | |
266 | # url('edit_repo', repo_name=ID) |
|
266 | # url('edit_repo', repo_name=ID) | |
267 | repo_model = RepoModel() |
|
267 | repo_model = RepoModel() | |
|
268 | r = ScmModel().get(repo_name) | |||
268 | c.repo_info = repo_model.get_by_repo_name(repo_name) |
|
269 | c.repo_info = repo_model.get_by_repo_name(repo_name) | |
269 | r = ScmModel().get(repo_name) |
|
270 | ||
|
271 | if c.repo_info is None: | |||
|
272 | h.flash(_('%s repository is not mapped to db perhaps' | |||
|
273 | ' it was created or renamed from the filesystem' | |||
|
274 | ' please run the application again' | |||
|
275 | ' in order to rescan repositories') % repo_name, | |||
|
276 | category='error') | |||
|
277 | ||||
|
278 | return redirect(url('repos')) | |||
270 |
|
279 | |||
271 | if c.repo_info.stats: |
|
280 | if c.repo_info.stats: | |
272 | last_rev = c.repo_info.stats.stat_on_revision |
|
281 | last_rev = c.repo_info.stats.stat_on_revision | |
@@ -282,15 +291,6 b' class ReposController(BaseController):' | |||||
282 | c.stats_percentage = '%.2f' % ((float((last_rev)) / |
|
291 | c.stats_percentage = '%.2f' % ((float((last_rev)) / | |
283 | c.repo_last_rev) * 100) |
|
292 | c.repo_last_rev) * 100) | |
284 |
|
293 | |||
285 | if not c.repo_info: |
|
|||
286 | h.flash(_('%s repository is not mapped to db perhaps' |
|
|||
287 | ' it was created or renamed from the filesystem' |
|
|||
288 | ' please run the application again' |
|
|||
289 | ' in order to rescan repositories') % repo_name, |
|
|||
290 | category='error') |
|
|||
291 |
|
||||
292 | return redirect(url('repos')) |
|
|||
293 |
|
||||
294 | defaults = c.repo_info.__dict__.copy() |
|
294 | defaults = c.repo_info.__dict__.copy() | |
295 | if c.repo_info.user: |
|
295 | if c.repo_info.user: | |
296 | defaults.update({'user':c.repo_info.user.username}) |
|
296 | defaults.update({'user':c.repo_info.user.username}) |
General Comments 0
You need to be logged in to leave comments.
Login now