Changeset - f6fcfc84f30c
[Not reviewed]
default
0 1 0
Søren Løvborg - 10 years ago 2015-08-18 11:47:18
sorenl@unity3d.com
spelling: unify messages for repository locking

Normalize phrasing and capitalization of repository locking messages.
This also avoids the piecing together of sentence fragments in a way
that can cause i18n headaches.
1 file changed with 4 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/repos.py
Show inline comments
 
@@ -531,16 +531,16 @@ class ReposController(BaseRepoController
 
        :param repo_name:
 
        """
 
        try:
 
            repo = Repository.get_by_repo_name(repo_name)
 
            if request.POST.get('set_lock'):
 
                Repository.lock(repo, c.authuser.user_id)
 
                h.flash(_('Locked repository'), category='success')
 
                h.flash(_('Repository has been locked'), category='success')
 
            elif request.POST.get('set_unlock'):
 
                Repository.unlock(repo)
 
                h.flash(_('Unlocked repository'), category='success')
 
                h.flash(_('Repository has been unlocked'), category='success')
 
        except Exception as e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during unlocking'),
 
                    category='error')
 
        return redirect(url('edit_repo_advanced', repo_name=repo_name))
 

	
 
@@ -555,19 +555,17 @@ class ReposController(BaseRepoController
 
        try:
 
            repo = Repository.get_by_repo_name(repo_name)
 

	
 
            if repo.enable_locking:
 
                if repo.locked[0]:
 
                    Repository.unlock(repo)
 
                    action = _('Unlocked')
 
                    h.flash(_('Repository has been unlocked'), category='success')
 
                else:
 
                    Repository.lock(repo, c.authuser.user_id)
 
                    action = _('Locked')
 
                    h.flash(_('Repository has been locked'), category='success')
 

	
 
                h.flash(_('Repository has been %s') % action,
 
                        category='success')
 
        except Exception as e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during unlocking'),
 
                    category='error')
 
        return redirect(url('summary_home', repo_name=repo_name))
 

	
0 comments (0 inline, 0 general)