diff --git a/rq/compat/__init__.py b/rq/compat/__init__.py index 5e660b5..3095983 100644 --- a/rq/compat/__init__.py +++ b/rq/compat/__init__.py @@ -69,7 +69,9 @@ else: string_types = (str, unicode) def as_text(v): - return v + if v is None: + return None + return v.decode('utf-8') def decode_redis_hash(h): return h diff --git a/rq/job.py b/rq/job.py index 6ba0807..e8080f8 100644 --- a/rq/job.py +++ b/rq/job.py @@ -407,8 +407,7 @@ class Job(object): self.created_at = to_date(as_text(obj.get('created_at'))) self.origin = as_text(obj.get('origin')) - self.description = (as_text(obj.get('description')).decode('utf-8') - if obj.get('description') else None) + self.description = as_text(obj.get('description')) self.enqueued_at = to_date(as_text(obj.get('enqueued_at'))) self.ended_at = to_date(as_text(obj.get('ended_at'))) self._result = unpickle(obj.get('result')) if obj.get('result') else None # noqa