diff --git a/fields/date.py b/fields/date.py index 2ca9469..522e2ab 100644 --- a/fields/date.py +++ b/fields/date.py @@ -33,9 +33,11 @@ def getDateFromIndexValue(indexValue): indexValue = (indexValue-hours) / 24 # The remaining part, in days # Get days day = indexValue % 31 + if day == 0: day = 31 indexValue = (indexValue-day) / 31 # The remaining part, in months # Get months month = indexValue % 12 + if month == 0: month = 12 year = (indexValue - month) / 12 from DateTime import DateTime utcDate = DateTime('%d/%d/%d %d:%d UTC' % (year,month,day,hours,minutes)) diff --git a/fields/workflow.py b/fields/workflow.py index 82f52f5..66e4c6e 100644 --- a/fields/workflow.py +++ b/fields/workflow.py @@ -153,12 +153,12 @@ class State: if isinstance(permissions, basestring): permissions = (permissions,) for perm, roles in self.permissions.iteritems(): if permissions and (perm not in permissions): continue - # Find and delete p_oldRoleName. + # Find and delete p_oldRoleName for role in roles: if role.name == oldRoleName: - # Remove p_oldRoleName. + # Remove p_oldRoleName roles.remove(role) - # Add p_newRoleName. + # Add p_newRoleName roles.append(self.getRole(newRoleName)) break