don't fail when we get a wrong time format when requesting contact time
This commit is contained in:
parent
9d307570df
commit
c7c5d0f66d
|
@ -1682,10 +1682,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
|||
def dst(self, dt):
|
||||
return ZERO
|
||||
|
||||
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
||||
t = t.replace(tzinfo=UTC())
|
||||
try:
|
||||
t = datetime.datetime.strptime(utc_time, '%Y-%m-%dT%H:%M:%SZ')
|
||||
t = t.replace(tzinfo=UTC())
|
||||
time_info = t.astimezone(contact_tz()).strftime('%c')
|
||||
except ValueError, e:
|
||||
log.info('Wrong time format: %s' % str(e))
|
||||
|
||||
time_info = t.astimezone(contact_tz()).strftime('%c')
|
||||
id_ = iq_obj.getID()
|
||||
if id_ in self.groupchat_jids:
|
||||
who = self.groupchat_jids[id_]
|
||||
|
|
Loading…
Reference in New Issue