[gen] Bugfix.
This commit is contained in:
parent
9566a7d788
commit
c6a376f420
|
@ -33,9 +33,11 @@ def getDateFromIndexValue(indexValue):
|
||||||
indexValue = (indexValue-hours) / 24 # The remaining part, in days
|
indexValue = (indexValue-hours) / 24 # The remaining part, in days
|
||||||
# Get days
|
# Get days
|
||||||
day = indexValue % 31
|
day = indexValue % 31
|
||||||
|
if day == 0: day = 31
|
||||||
indexValue = (indexValue-day) / 31 # The remaining part, in months
|
indexValue = (indexValue-day) / 31 # The remaining part, in months
|
||||||
# Get months
|
# Get months
|
||||||
month = indexValue % 12
|
month = indexValue % 12
|
||||||
|
if month == 0: month = 12
|
||||||
year = (indexValue - month) / 12
|
year = (indexValue - month) / 12
|
||||||
from DateTime import DateTime
|
from DateTime import DateTime
|
||||||
utcDate = DateTime('%d/%d/%d %d:%d UTC' % (year,month,day,hours,minutes))
|
utcDate = DateTime('%d/%d/%d %d:%d UTC' % (year,month,day,hours,minutes))
|
||||||
|
|
|
@ -153,12 +153,12 @@ class State:
|
||||||
if isinstance(permissions, basestring): permissions = (permissions,)
|
if isinstance(permissions, basestring): permissions = (permissions,)
|
||||||
for perm, roles in self.permissions.iteritems():
|
for perm, roles in self.permissions.iteritems():
|
||||||
if permissions and (perm not in permissions): continue
|
if permissions and (perm not in permissions): continue
|
||||||
# Find and delete p_oldRoleName.
|
# Find and delete p_oldRoleName
|
||||||
for role in roles:
|
for role in roles:
|
||||||
if role.name == oldRoleName:
|
if role.name == oldRoleName:
|
||||||
# Remove p_oldRoleName.
|
# Remove p_oldRoleName
|
||||||
roles.remove(role)
|
roles.remove(role)
|
||||||
# Add p_newRoleName.
|
# Add p_newRoleName
|
||||||
roles.append(self.getRole(newRoleName))
|
roles.append(self.getRole(newRoleName))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue