Commits

Marcin Kuzminski committed 9caca00

fixes #87, stupid __dict__ call on sqlalchemy session followed by update() for this dict object rewrote an object to string.

Comments (0)

Files changed (4)

rhodecode/controllers/admin/repos.py

         # url('edit_repo', repo_name=ID)
         repo_model = RepoModel()
         c.repo_info = repo_model.get_by_repo_name(repo_name)
+        r = ScmModel().get(repo_name)
+
         if c.repo_info.stats:
             last_rev = c.repo_info.stats.stat_on_revision
         else:
             last_rev = 0
         c.stats_revision = last_rev
-        r = ScmModel().get(repo_name)
+
         c.repo_last_rev = r.revisions[-1] if r.revisions else 0
 
         if last_rev == 0:
             c.stats_percentage = '%.2f' % ((float((last_rev)) /
                                             c.repo_last_rev) * 100)
 
-
         if not c.repo_info:
             h.flash(_('%s repository is not mapped to db perhaps'
                       ' it was created or renamed from the filesystem'
 
             return redirect(url('repos'))
 
-        defaults = c.repo_info.__dict__
+        defaults = c.repo_info.__dict__.copy()
         if c.repo_info.user:
             defaults.update({'user':c.repo_info.user.username})
         else:

rhodecode/controllers/admin/settings.py

               " crucial for entire application"), category='warning')
             return redirect(url('users'))
 
-        defaults = c.user.__dict__
+        defaults = c.user.__dict__.copy()
         return htmlfill.render(
             render('admin/users/user_edit_my_account.html'),
             defaults=defaults,

rhodecode/controllers/admin/users.py

             h.flash(_("You can't edit this user"), category='warning')
             return redirect(url('users'))
 
-        defaults = c.user.__dict__
+        defaults = c.user.__dict__.copy()
         return htmlfill.render(
             render('admin/users/user_edit.html'),
             defaults=defaults,

rhodecode/controllers/settings.py

                       category='error')
 
             return redirect(url('home'))
-        defaults = c.repo_info.__dict__
+        defaults = c.repo_info.__dict__.copy()
         defaults.update({'user':c.repo_info.user.username})
         c.users_array = repo_model.get_users_js()