~sircmpwn/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH reminderbot] Convert timezone into a str before save

Details
Message ID
<20210330203420.1768488-1-porcellis@eletrotupi.com>
DKIM signature
pass
Download raw message
Patch: +3 -2
It was trying to shove it a DstTzInfo entirely into redis which was
complaining that it should convert to a byte, string or number first.
---
 reminderbot/bot.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/reminderbot/bot.py b/reminderbot/bot.py
index 01cc30b..0e81a0c 100755
--- a/reminderbot/bot.py
+++ b/reminderbot/bot.py
@@ -87,9 +87,10 @@ async def tz(tz, message=None):
    ".tz [timezone]: Sets the user's timezone"
    try:
        tz = timezone(tz)
        redis.set("tz." + message.sender.name, tz)
        redis.set("tz." + message.sender.name, str(tz))
        return "Got it"
    except:
    except Exception as e:
        logger.debug(f"Something was wrong when parsing the tz: {e}")
        return "I don't know that timezone. See https://github.com/newvem/pytz"

@cmds.command("remindme")
-- 
2.31.0

Re: [PATCH reminderbot] Convert timezone into a str before save

Details
Message ID
<CACGNLZR1GKW.F3I1UMFO9YDL@taiga>
In-Reply-To
<20210330203420.1768488-1-porcellis@eletrotupi.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/reminderbot
   adace72..  master -> master
Reply to thread Export thread (mbox)