diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 5263808..47eb5d2 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -64,9 +64,10 @@ class PublicRelations(Bureau): take a tweet id and return a short alphanumeric code """ shortcode = ''.join(random.choice(string.ascii_letters + string.digits) - for _ in range(5)).encode() + for _ in range(5)) with self.dbenv.begin(db=self.tweetdb, write=True) as txn: - txn.put(shortcode, tweet_id.encode()) + txn.put(shortcode.encode(), tweet_id.encode()) + return shortcode @add_command("tweetpic", "Post a Document Camera Image to Twitter") def tweet_pic(self):