-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix 'NoneType' object has no attribute 'utcoffset' #522
Conversation
|
Hi @paulfab, thanks for taking the time to fix this error! Would you mind signing the CLA (please check the above bot message)? Without having it, we are unable to merge your changes in this repository. |
@@ -58,7 +58,7 @@ def save_bot(self, bot: Bot): | |||
b = bot.to_dict() | |||
if is_naive(b["installed_at"]): | |||
b["installed_at"] = make_aware(b["installed_at"]) | |||
if "bot_token_expires_at" in b is not None and is_naive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, this part was wrong.
@@ -33,9 +33,9 @@ def save(self, installation: Installation): | |||
i = installation.to_dict() | |||
if is_naive(i["installed_at"]): | |||
i["installed_at"] = make_aware(i["installed_at"]) | |||
if "bot_token_expires_at" in i and is_naive(i["bot_token_expires_at"]): | |||
if i.get("bot_token_expires_at") and is_naive(i["bot_token_expires_at"]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this way for consistency?
if i.get("bot_token_expires_at") and is_naive(i["bot_token_expires_at"]): | |
if i.get("bot_token_expires_at") is not None and is_naive(i["bot_token_expires_at"]): |
i["bot_token_expires_at"] = make_aware(i["bot_token_expires_at"]) | ||
if "user_token_expires_at" in i and is_naive(i["user_token_expires_at"]): | ||
if i.get("user_token_expires_at") and is_naive(i["user_token_expires_at"]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
if i.get("user_token_expires_at") and is_naive(i["user_token_expires_at"]): | |
if i.get("user_token_expires_at") is not None and is_naive(i["user_token_expires_at"]): |
Codecov Report
@@ Coverage Diff @@
## main #522 +/- ##
=======================================
Coverage 91.29% 91.29%
=======================================
Files 169 169
Lines 5606 5606
=======================================
Hits 5118 5118
Misses 488 488 Continue to review full report at Codecov.
|
@paulfab Thanks for updating this pull request. Would you mind signing the CLA (please check the above bot message)? Without having it, we are unable to merge your changes in this repository. |
Hey @seratch you are so fast I didnt have the time to comment ^^. Thanks for reviewing the PR, I'm quite reluctant to sign the CLA. You can take ownership of my modest changes and merge it ? |
@paulfab Okay, in the case, I can come up with my own pull request instead. Thanks a lot for taking the time to report this! |
Let me close this pull request in favor of #523 |
(Describe the goal of this PR. Mention any related Issue numbers)
Category (place an
x
in each of the[ ]
)slack_bolt.App
and/or its core componentsslack_bolt.async_app.AsyncApp
and/or its core components/docs
slack_bolt.adapter
Requirements (place an
x
in each[ ]
)Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.sh
after making the changes.