diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-12 20:44:27 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-12 20:44:27 +0200 |
commit | 91229fc5dd982290c94d0ee6d46aff630839a07a (patch) | |
tree | 621c5680453ec9549db9ecdbb0ea2863115bd704 | |
parent | 68e25739d0a9c9de3f746aa7645a7680cb26c6dc (diff) | |
parent | 50a5a5333cacf55dd6db1a8619a641f3a22bb617 (diff) | |
download | Ishtar-91229fc5dd982290c94d0ee6d46aff630839a07a.tar.bz2 Ishtar-91229fc5dd982290c94d0ee6d46aff630839a07a.zip |
Merge branch 'master-pdl'
-rw-r--r-- | ishtar_common/wizards.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 8bb0dc00b..97bb6fb37 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -90,15 +90,14 @@ def check_rights_condition(rights): return False return func - +# buggy and unecessary at least for the moment... +""" def _check_right(step, condition=True): '''Return a method to check the right for a specific step''' def check_right(self): cond = condition - # TODO: cond.__name__ != 'check_right' prevent unexplicated - # infinite loop... to be fixed - if callable(cond) and cond.__name__ != 'check_right': - cond = cond(self) + if callable(condition): + cond = condition(self) if not cond: return False return True @@ -108,6 +107,7 @@ def _check_right(step, condition=True): return self.request.user.ishtaruser.has_right( ('administrator', step), session=self.request.session) return check_right +""" class Wizard(NamedUrlWizardView): @@ -124,6 +124,8 @@ class Wizard(NamedUrlWizardView): filter_owns = {} current_obj_slug = '' + ''' + # buggy and unecessary... def __init__(self, *args, **kwargs): """Check right for each step of the wizard""" super(Wizard, self).__init__(*args, **kwargs) @@ -131,6 +133,7 @@ class Wizard(NamedUrlWizardView): condition = self.condition_dict.get(form_key, True) cond = _check_right(form_key, condition) self.condition_dict[form_key] = cond + ''' def dispatch(self, request, *args, **kwargs): self.current_right = kwargs.get('current_right', None) |