[gen] Bugfix.

This commit is contained in:
Gaetan Delannay 2015-01-28 18:26:58 +01:00
parent 9566a7d788
commit c6a376f420
2 changed files with 5 additions and 3 deletions

View file

@ -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))

View file

@ -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