Storycraft: don't try to replace() on end_time when it's None
This commit is contained in:
parent
b48b016693
commit
0a2aa21777
@ -557,7 +557,9 @@ class Storycraft(Module):
|
|||||||
game.owner_nick = result['owner_nick']
|
game.owner_nick = result['owner_nick']
|
||||||
game.owner_userhost = result['owner_userhost']
|
game.owner_userhost = result['owner_userhost']
|
||||||
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
||||||
game.end_time = result['end_time'].replace(tzinfo=tzlocal())
|
game.end_time = result['end_time']
|
||||||
|
if game.end_time is not None:
|
||||||
|
game.end_time = game.end_time.replace(tzinfo=tzlocal())
|
||||||
|
|
||||||
return game
|
return game
|
||||||
except mdb.Error as e:
|
except mdb.Error as e:
|
||||||
@ -864,7 +866,9 @@ class Storycraft(Module):
|
|||||||
game.owner_nick = result['owner_nick']
|
game.owner_nick = result['owner_nick']
|
||||||
game.owner_userhost = result['owner_userhost']
|
game.owner_userhost = result['owner_userhost']
|
||||||
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
||||||
game.end_time = result['end_time'].replace(tzinfo=tzlocal())
|
game.end_time = result['end_time']
|
||||||
|
if game.end_time is not None:
|
||||||
|
game.end_time = game.end_time.replace(tzinfo=tzlocal())
|
||||||
|
|
||||||
games.append(game)
|
games.append(game)
|
||||||
|
|
||||||
@ -917,7 +921,9 @@ class Storycraft(Module):
|
|||||||
game.owner_nick = result['owner_nick']
|
game.owner_nick = result['owner_nick']
|
||||||
game.owner_userhost = result['owner_userhost']
|
game.owner_userhost = result['owner_userhost']
|
||||||
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
||||||
game.end_time = result['end_time'].replace(tzinfo=tzlocal())
|
game.end_time = result['end_time']
|
||||||
|
if game.end_time is not None:
|
||||||
|
game.end_time = game.end_time.replace(tzinfo=tzlocal())
|
||||||
|
|
||||||
games.append(game)
|
games.append(game)
|
||||||
|
|
||||||
@ -957,7 +963,9 @@ class Storycraft(Module):
|
|||||||
game.owner_nick = result['owner_nick']
|
game.owner_nick = result['owner_nick']
|
||||||
game.owner_userhost = result['owner_userhost']
|
game.owner_userhost = result['owner_userhost']
|
||||||
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
game.start_time = result['start_time'].replace(tzinfo=tzlocal())
|
||||||
game.end_time = result['end_time'].replace(tzinfo=tzlocal())
|
game.end_time = result['end_time']
|
||||||
|
if game.end_time is not None:
|
||||||
|
game.end_time = game.end_time.replace(tzinfo=tzlocal())
|
||||||
|
|
||||||
games.append(game)
|
games.append(game)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user