Avoid UTC datetime
utcfromtimestamp() does not seems reliable and qubes-manager uses local time
This commit is contained in:
parent
b3b18f97f8
commit
6e8e48e32d
@ -204,7 +204,7 @@ class SpecialTarget(RuleChoice):
|
||||
class Expire(RuleOption):
|
||||
def __init__(self, untrusted_value):
|
||||
super(Expire, self).__init__(untrusted_value)
|
||||
self.datetime = datetime.datetime.utcfromtimestamp(int(untrusted_value))
|
||||
self.datetime = datetime.datetime.fromtimestamp(int(untrusted_value))
|
||||
|
||||
@property
|
||||
def rule(self):
|
||||
@ -216,7 +216,7 @@ class Expire(RuleOption):
|
||||
|
||||
@property
|
||||
def expired(self):
|
||||
return self.datetime < datetime.datetime.utcnow()
|
||||
return self.datetime < datetime.datetime.now()
|
||||
|
||||
|
||||
class Comment(RuleOption):
|
||||
|
Loading…
Reference in New Issue
Block a user