[PATCH 3 of 6 v2] controllers, lib: reduce log level of flashes

Thomas De Schampheleire patrickdepinguin at gmail.com
Sun May 10 14:22:55 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1427577130 -3600
#      Sat Mar 28 22:12:10 2015 +0100
# Node ID d43625532cf7059cf8f9647b008957f7b9c868d6
# Parent  b7e259611340434bead43af0327e5be53275319b
controllers, lib: reduce log level of flashes

Reduce log level of flashes of category 'error' that are actually user
errors.

diff --git a/kallithea/controllers/admin/settings.py b/kallithea/controllers/admin/settings.py
--- a/kallithea/controllers/admin/settings.py
+++ b/kallithea/controllers/admin/settings.py
@@ -355,7 +355,8 @@ class SettingsController(BaseController)
             test_body = ('Kallithea Email test, '
                                'Kallithea version: %s' % c.kallithea_version)
             if not test_email:
-                h.flash(_('Please enter email address'), category='error')
+                h.flash(_('Please enter email address'), category='error',
+                        log_category='info')
                 return redirect(url('admin_settings_email'))
 
             test_email_txt_body = EmailNotificationModel()\
diff --git a/kallithea/controllers/admin/user_groups.py b/kallithea/controllers/admin/user_groups.py
--- a/kallithea/controllers/admin/user_groups.py
+++ b/kallithea/controllers/admin/user_groups.py
@@ -311,7 +311,8 @@ class UserGroupsController(BaseControlle
             UserGroupModel()._update_permissions(user_group, form['perms_new'],
                                                  form['perms_updates'])
         except RepoGroupAssignmentError:
-            h.flash(_('Target group cannot be the same'), category='error')
+            h.flash(_('Target group cannot be the same'), category='error',
+                    log_category='info')
             return redirect(url('edit_user_group_perms', id=id))
         #TODO: implement this
         #action_logger(self.authuser, 'admin_changed_repo_permissions',
diff --git a/kallithea/controllers/changelog.py b/kallithea/controllers/changelog.py
--- a/kallithea/controllers/changelog.py
+++ b/kallithea/controllers/changelog.py
@@ -84,7 +84,7 @@ class ChangelogController(BaseRepoContro
             return c.db_repo_scm_instance.get_changeset(rev)
         except EmptyRepositoryError, e:
             h.flash(h.literal(_('There are no changesets yet')),
-                    category='error')
+                    category='error', log_category='info')
         except RepositoryError, e:
             log.error(traceback.format_exc())
             h.flash(safe_str(e), category='error')
diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py
--- a/kallithea/controllers/changeset.py
+++ b/kallithea/controllers/changeset.py
@@ -378,7 +378,7 @@ class ChangesetController(BaseRepoContro
                     dont_allow_on_closed_pull_request=True
                 )
             except StatusChangeOnClosedPullRequestError:
-                log.error(traceback.format_exc())
+                log.debug(traceback.format_exc())
                 msg = _('Changing status on a changeset associated with '
                         'a closed pull request is not allowed')
                 h.flash(msg, category='warning')
diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py
--- a/kallithea/lib/base.py
+++ b/kallithea/lib/base.py
@@ -447,7 +447,7 @@ class BaseRepoController(BaseController)
             if returnempty:
                 return repo.scm_instance.EMPTY_CHANGESET
             h.flash(h.literal(_('There are no changesets yet')),
-                    category='error')
+                    category='error', log_category='info')
             raise webob.exc.HTTPNotFound()
         except ChangesetDoesNotExistError as e:
             h.flash(h.literal(_('Changeset not found')),


More information about the kallithea-general mailing list