Commits

Kai Diefenbach committed 55e2ea8 Merge

Merge

Comments (0)

Files changed (6)

 069e96ddd6cb6e3107d6a872735b8d7ead00f30c 1.0a4
 7ad2b5c97b0eaf6d0d0579b38be80fb847d201cd 1.0b1
 8be56091dba07e2e4932660f23ee911929fafb36 1.0b2
+32014126335db4c016fff0b24a5ede7a9a68e35a 1.0b3
 Changes
 =======
 
+1.0 beta 3 (2010-07-07)
+-----------------------
+
+* Bugfix utils.get_allowed_transitions; issue #2
+* Bugfix: get_workflow_for_object method; issue #3
+
 1.0 beta 2 (2010-05-19)
 ------------------------
 
 from setuptools import setup, find_packages
 import os
 
-version = '1.0b2'
+version = '1.0b3'
 
 here = os.path.abspath(os.path.dirname(__file__))
 README = open(os.path.join(here, 'README.txt')).read()

workflows/models.py

         transitions = []
         for transition in self.transitions.all():
             permission = transition.permission
-            if permission is None or permissions.utils.has_permission(obj, user, permission.codename):
+            if permission is None:
                transitions.append(transition)
-
+            else:
+                # First we try to get the objects specific has_permission
+                # method (in case the object inherits from the PermissionBase
+                # class).
+                try:
+                    if obj.has_permission(user, permission.codename):
+                        transitions.append(transition)
+                except AttributeError:
+                    if permissions.utils.has_permission(obj, user, permission.codename):
+                        transitions.append(transition)
         return transitions
 
 class Transition(models.Model):

workflows/tests.py

File contents unchanged.

workflows/utils.py

File contents unchanged.