File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
examples/django/oauth_app Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ def save(self, installation: Installation):
3333 i = installation .to_dict ()
3434 if is_naive (i ["installed_at" ]):
3535 i ["installed_at" ] = make_aware (i ["installed_at" ])
36- if "bot_token_expires_at" in i and is_naive (i ["bot_token_expires_at" ]):
36+ if i .get ("bot_token_expires_at" ) is not None and is_naive (
37+ i ["bot_token_expires_at" ]
38+ ):
3739 i ["bot_token_expires_at" ] = make_aware (i ["bot_token_expires_at" ])
38- if "user_token_expires_at" in i and is_naive (i ["user_token_expires_at" ]):
40+ if i .get ("user_token_expires_at" ) is not None and is_naive (
41+ i ["user_token_expires_at" ]
42+ ):
3943 i ["user_token_expires_at" ] = make_aware (i ["user_token_expires_at" ])
4044 i ["client_id" ] = self .client_id
4145 row_to_update = (
@@ -58,7 +62,7 @@ def save_bot(self, bot: Bot):
5862 b = bot .to_dict ()
5963 if is_naive (b ["installed_at" ]):
6064 b ["installed_at" ] = make_aware (b ["installed_at" ])
61- if "bot_token_expires_at" in b is not None and is_naive (
65+ if b . get ( "bot_token_expires_at" ) is not None and is_naive (
6266 b ["bot_token_expires_at" ]
6367 ):
6468 b ["bot_token_expires_at" ] = make_aware (b ["bot_token_expires_at" ])
You can’t perform that action at this time.
0 commit comments