~ubuntu-branches/ubuntu/trusty/horizon/trusty

« back to all changes in this revision

Viewing changes to horizon/tables/actions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-09 11:50:22 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120309115022-ymiww5i58rbg97my
Tags: 2012.1~rc1~20120308.1479-0ubuntu1
* New upstream version.
* debian/rules: Fix symlink when installing horizon.
  (LP: #947118)
* debian/control: Add python-django-nose as a dep. (LP: #944235)
* debian/control: Fix broken depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
        #Begin with success message class, downgrade to info if problems
499
499
        success_message_level = messages.success
500
500
        if action_not_allowed:
501
 
            messages.error(request, _('You do not have permission to %s: %s') %
502
 
                           (self._conjugate(action_not_allowed).lower(),
503
 
                            ", ".join(action_not_allowed)))
 
501
            msg = _('You do not have permission to %(action)s: %(objs)s')
 
502
            params = {"action": self._conjugate(action_not_allowed).lower(),
 
503
                      "objs": ", ".join(action_not_allowed)}
 
504
            messages.error(request, msg % params)
504
505
            success_message_level = messages.info
505
506
        if action_failure:
506
 
            messages.error(request, _('Unable to %s: %s') % (
507
 
                    self._conjugate(action_failure).lower(),
508
 
                    ", ".join(action_failure)))
 
507
            msg = _('Unable to %(action)s: %(objs)s')
 
508
            params = {"action": self._conjugate(action_failure).lower(),
 
509
                      "objs": ", ".join(action_failure)}
 
510
            messages.error(request, msg % params)
509
511
            success_message_level = messages.info
510
512
        if action_success:
511
 
            success_message_level(request, _('%s: %s') % (
512
 
                    self._conjugate(action_success, True),
513
 
                    ", ".join(action_success)))
 
513
            msg = _('%(action)s: %(objs)s')
 
514
            params = {"action": self._conjugate(action_success, True),
 
515
                      "objs": ", ".join(action_success)}
 
516
            success_message_level(request, msg % params)
514
517
 
515
518
        return shortcuts.redirect(self.get_success_url(request))
516
519