diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-19 19:22:08 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-19 19:22:08 +0100 |
commit | c3f043e4937bd9ed7c68a38488e588866943f4c5 (patch) | |
tree | 48ecf37a9c135f85786e7ba9d1d24c75b4366c29 /chimere/actions.py | |
parent | b3058742a5acc9ca19a5edc31260b9ad0ca5ba5a (diff) | |
download | Chimère-c3f043e4937bd9ed7c68a38488e588866943f4c5.tar.bz2 Chimère-c3f043e4937bd9ed7c68a38488e588866943f4c5.zip |
Flake8
Diffstat (limited to 'chimere/actions.py')
-rw-r--r-- | chimere/actions.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/chimere/actions.py b/chimere/actions.py index e83d8c3..9b66492 100644 --- a/chimere/actions.py +++ b/chimere/actions.py @@ -21,12 +21,12 @@ Actions available in the main interface """ from django.conf import settings -from django.contrib.auth import models from django.core.urlresolvers import reverse, NoReverseMatch from django.utils.translation import ugettext_lazy as _ from models import Page + class Action: def __init__(self, id, path, label, extra_url_args=[]): self.id, self.path, self.label = id, path, label @@ -34,18 +34,22 @@ class Action: def update_url(self, area_name): try: - self.url = reverse(self.path, - args=[area_name if area_name else ''] + self.extra_url_args) + self.url = reverse( + self.path, + args=[area_name if area_name else ''] + self.extra_url_args) except NoReverseMatch: # backward url management - self.url = reverse(self.path, - args=[area_name + '/' if area_name else ''] + self.extra_url_args) + self.url = reverse( + self.path, + args=[area_name + '/' if area_name else ''] + + self.extra_url_args) -default_actions = [(Action('view', 'chimere:index', _('View')), []), - (Action('contribute', 'chimere:edit', _('Contribute')), - (Action('edit', 'chimere:edit', _('Add a new point of interest')), - Action('edit-route', 'chimere:editroute', _('Add a new route'))), - ),] +default_actions = [ + (Action('view', 'chimere:index', _('View')), []), + (Action('contribute', 'chimere:edit', _('Contribute')), + (Action('edit', 'chimere:edit', _('Add a new point of interest')), + Action('edit-route', 'chimere:editroute', _('Add a new route'))), + )] if hasattr(settings, 'CHIMERE_DIRECTORY') and settings.CHIMERE_DIRECTORY: default_actions.append((Action('categories', 'chimere:category-directory', |