Fix OBSLock to always write full ISO format
If the microseconds are 0, isoformat won't output any, but our _parse function expects them. python 3.7 has isoformat/fromisoformat, which would fix it, but we can't take it atm
This commit is contained in:
parent
0693c88977
commit
5f3dcca267
@ -33,7 +33,7 @@ class OBSLock(object):
|
|||||||
if self.reason_sub:
|
if self.reason_sub:
|
||||||
reason += ' ({})'.format(self.reason_sub)
|
reason += ' ({})'.format(self.reason_sub)
|
||||||
reason = reason.replace('@', 'at').replace('#', 'hash')
|
reason = reason.replace('@', 'at').replace('#', 'hash')
|
||||||
return '%s#%s@%s' % (self.user, reason, datetime.isoformat(datetime.utcnow()))
|
return '%s#%s@%s' % (self.user, reason, datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%f'))
|
||||||
|
|
||||||
def _parse(self, signature):
|
def _parse(self, signature):
|
||||||
"""Parse a signature into an user and a timestamp."""
|
"""Parse a signature into an user and a timestamp."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user