Show More
@@ -266,12 +266,14 b' class ReposController(BaseController):' | |||||
266 | # url('edit_repo', repo_name=ID) |
|
266 | # url('edit_repo', repo_name=ID) | |
267 | repo_model = RepoModel() |
|
267 | repo_model = RepoModel() | |
268 | c.repo_info = repo_model.get_by_repo_name(repo_name) |
|
268 | c.repo_info = repo_model.get_by_repo_name(repo_name) | |
|
269 | r = ScmModel().get(repo_name) | |||
|
270 | ||||
269 | if c.repo_info.stats: |
|
271 | if c.repo_info.stats: | |
270 | last_rev = c.repo_info.stats.stat_on_revision |
|
272 | last_rev = c.repo_info.stats.stat_on_revision | |
271 | else: |
|
273 | else: | |
272 | last_rev = 0 |
|
274 | last_rev = 0 | |
273 | c.stats_revision = last_rev |
|
275 | c.stats_revision = last_rev | |
274 | r = ScmModel().get(repo_name) |
|
276 | ||
275 | c.repo_last_rev = r.revisions[-1] if r.revisions else 0 |
|
277 | c.repo_last_rev = r.revisions[-1] if r.revisions else 0 | |
276 |
|
278 | |||
277 | if last_rev == 0: |
|
279 | if last_rev == 0: | |
@@ -280,7 +282,6 b' class ReposController(BaseController):' | |||||
280 | c.stats_percentage = '%.2f' % ((float((last_rev)) / |
|
282 | c.stats_percentage = '%.2f' % ((float((last_rev)) / | |
281 | c.repo_last_rev) * 100) |
|
283 | c.repo_last_rev) * 100) | |
282 |
|
284 | |||
283 |
|
||||
284 | if not c.repo_info: |
|
285 | if not c.repo_info: | |
285 | h.flash(_('%s repository is not mapped to db perhaps' |
|
286 | h.flash(_('%s repository is not mapped to db perhaps' | |
286 | ' it was created or renamed from the filesystem' |
|
287 | ' it was created or renamed from the filesystem' | |
@@ -290,7 +291,7 b' class ReposController(BaseController):' | |||||
290 |
|
291 | |||
291 | return redirect(url('repos')) |
|
292 | return redirect(url('repos')) | |
292 |
|
293 | |||
293 | defaults = c.repo_info.__dict__ |
|
294 | defaults = c.repo_info.__dict__.copy() | |
294 | if c.repo_info.user: |
|
295 | if c.repo_info.user: | |
295 | defaults.update({'user':c.repo_info.user.username}) |
|
296 | defaults.update({'user':c.repo_info.user.username}) | |
296 | else: |
|
297 | else: |
@@ -258,7 +258,7 b' class SettingsController(BaseController)' | |||||
258 | " crucial for entire application"), category='warning') |
|
258 | " crucial for entire application"), category='warning') | |
259 | return redirect(url('users')) |
|
259 | return redirect(url('users')) | |
260 |
|
260 | |||
261 | defaults = c.user.__dict__ |
|
261 | defaults = c.user.__dict__.copy() | |
262 | return htmlfill.render( |
|
262 | return htmlfill.render( | |
263 | render('admin/users/user_edit_my_account.html'), |
|
263 | render('admin/users/user_edit_my_account.html'), | |
264 | defaults=defaults, |
|
264 | defaults=defaults, |
@@ -158,7 +158,7 b' class UsersController(BaseController):' | |||||
158 | h.flash(_("You can't edit this user"), category='warning') |
|
158 | h.flash(_("You can't edit this user"), category='warning') | |
159 | return redirect(url('users')) |
|
159 | return redirect(url('users')) | |
160 |
|
160 | |||
161 | defaults = c.user.__dict__ |
|
161 | defaults = c.user.__dict__.copy() | |
162 | return htmlfill.render( |
|
162 | return htmlfill.render( | |
163 | render('admin/users/user_edit.html'), |
|
163 | render('admin/users/user_edit.html'), | |
164 | defaults=defaults, |
|
164 | defaults=defaults, |
@@ -56,7 +56,7 b' class SettingsController(BaseController)' | |||||
56 | category='error') |
|
56 | category='error') | |
57 |
|
57 | |||
58 | return redirect(url('home')) |
|
58 | return redirect(url('home')) | |
59 | defaults = c.repo_info.__dict__ |
|
59 | defaults = c.repo_info.__dict__.copy() | |
60 | defaults.update({'user':c.repo_info.user.username}) |
|
60 | defaults.update({'user':c.repo_info.user.username}) | |
61 | c.users_array = repo_model.get_users_js() |
|
61 | c.users_array = repo_model.get_users_js() | |
62 |
|
62 |
@@ -144,13 +144,7 b' class ScmModel(BaseModel):' | |||||
144 | tmp_d['tip'] = tip.raw_id |
|
144 | tmp_d['tip'] = tip.raw_id | |
145 | tmp_d['tip_sort'] = tip.revision |
|
145 | tmp_d['tip_sort'] = tip.revision | |
146 | tmp_d['rev'] = tip.revision |
|
146 | tmp_d['rev'] = tip.revision | |
147 |
|
147 | tmp_d['contact'] = repo.dbrepo.user.full_contact | ||
148 | #dirty hack for some problems |
|
|||
149 | usr = repo.dbrepo.user |
|
|||
150 | if isinstance(usr, basestring): |
|
|||
151 | usr = UserModel(self.sa).get_by_username(repo.dbrepo.user) |
|
|||
152 |
|
||||
153 | tmp_d['contact'] = usr.full_contact |
|
|||
154 | tmp_d['contact_sort'] = tmp_d['contact'] |
|
148 | tmp_d['contact_sort'] = tmp_d['contact'] | |
155 | tmp_d['repo_archives'] = list(repo._get_archives()) |
|
149 | tmp_d['repo_archives'] = list(repo._get_archives()) | |
156 | tmp_d['last_msg'] = tip.message |
|
150 | tmp_d['last_msg'] = tip.message |
General Comments 0
You need to be logged in to leave comments.
Login now