Changeset - 5bb7a18b0431
[Not reviewed]
stable
0 1 0
Thomas De Schampheleire - 7 years ago 2019-04-16 21:52:51
thomas.de_schampheleire@nokia.com
settings: rework logic for flash message after repository scan

Make the code more readable by extracting added_msg and removed_msg away
from the h.flash() call and reindenting the logic.
There are no functional changes here.

These changes serve as preparatory work for a subsequent commit that will
change the logic.
1 file changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/settings.py
Show inline comments
 
@@ -171,11 +171,14 @@ class SettingsController(BaseController)
 
                                            install_git_hooks=install_git_hooks,
 
                                            user=request.authuser.username,
 
                                            overwrite_git_hooks=overwrite_git_hooks)
 
            added_msg = ', '.join(
 
                h.link_to(safe_unicode(repo_name), h.url('summary_home', repo_name=repo_name)) for repo_name in added
 
            ) or '-'
 
            removed_msg = ', '.join(
 
                h.escape(safe_unicode(repo_name)) for repo_name in removed
 
            ) or '-'
 
            h.flash(h.literal(_('Repositories successfully rescanned. Added: %s. Removed: %s.') %
 
                (', '.join(h.link_to(safe_unicode(repo_name), h.url('summary_home', repo_name=repo_name))
 
                 for repo_name in added) or '-',
 
                 ', '.join(h.escape(safe_unicode(repo_name)) for repo_name in removed) or '-')),
 
                category='success')
 
                    (added_msg, removed_msg)), category='success')
 

	
 
            if invalidate_cache:
 
                log.debug('invalidating all repositories cache')
0 comments (0 inline, 0 general)