diff --git a/notification/engine.py b/notification/engine.py index ee901b96..026a2acc 100644 --- a/notification/engine.py +++ b/notification/engine.py @@ -38,7 +38,7 @@ def send_all(): try: for queued_batch in NoticeQueueBatch.objects.all(): - notices = pickle.loads(str(queued_batch.pickled_data)) + notices = pickle.loads(str(queued_batch.pickled_data).decode("base64")) for user, label, extra_context, on_site in notices: user = User.objects.get(pk=user) logging.info("emitting notice to %s" % user) diff --git a/notification/models.py b/notification/models.py index 4649e25d..64b1f3fd 100644 --- a/notification/models.py +++ b/notification/models.py @@ -339,7 +339,7 @@ def queue(users, label, extra_context=None, on_site=True): notices = [] for user in users: notices.append((user, label, extra_context, on_site)) - NoticeQueueBatch(pickled_data=pickle.dumps(notices)).save() + NoticeQueueBatch(pickled_data=pickle.dumps(notices).encode("base64")).save() class ObservedItemManager(models.Manager):