one last exciting unicode fix

workspace
Brendan Howell 8 years ago
parent 584595232c
commit fc5cea7e0c

@ -140,7 +140,7 @@ class MailRoom(Bureau):
with self.dbenv.begin(db=self.postdb_rev, write=True) as txn: with self.dbenv.begin(db=self.postdb_rev, write=True) as txn:
shortcode = txn.get(msgid) shortcode = txn.get(msgid)
if shortcode is not None: if shortcode is not None:
return shortcode return shortcode.decode("utf-8")
else: else:
shortcode = ''.join(random.choice(string.ascii_letters + shortcode = ''.join(random.choice(string.ascii_letters +
string.digits) for _ in range(5)).encode() string.digits) for _ in range(5)).encode()
@ -148,7 +148,7 @@ class MailRoom(Bureau):
txn.put(msgid, shortcode) txn.put(msgid, shortcode)
with self.dbenv.begin(db=self.postdb, write=True) as txn: with self.dbenv.begin(db=self.postdb, write=True) as txn:
txn.put(shortcode, msgid) txn.put(shortcode, msgid)
return shortcode.decode() return shortcode.decode("utf-8")
@add_command("fax", "Send a Document Camera Image via Email") @add_command("fax", "Send a Document Camera Image via Email")
def fax(self, data): def fax(self, data):

Loading…
Cancel
Save