Skip to content

Commit

Permalink
Merge branch 'release/0.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
cthtuf committed Mar 2, 2019
2 parents 692837c + 42df4ea commit 49caa9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dramatiq_tasks_manager.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: dramatiq-tasks-manager
Version: 0.0.9
Version: 0.0.10
Summary: This package provides API interface for executing and scheduling tasks. It depends on dramatiq and apscheduler
Home-page: https://github.com/cthtuf/dramatiq-tasks-manager
Author: cthtuf
Expand Down
1 change: 1 addition & 0 deletions dramatiq_tasks_manager.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dramatiq_tasks_manager/permissions.py
dramatiq_tasks_manager/scheduler.py
dramatiq_tasks_manager/serializers.py
dramatiq_tasks_manager/settings.py
dramatiq_tasks_manager/tasks.py
dramatiq_tasks_manager/tests.py
dramatiq_tasks_manager/urls.py
dramatiq_tasks_manager/utils.py
Expand Down
10 changes: 9 additions & 1 deletion dramatiq_tasks_manager/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,23 @@ class Meta:

class TaskDetailSerializer(serializers.ModelSerializer):
message = serializers.SerializerMethodField()
result = serializers.SerializerMethodField()

class Meta:
model = Task
fields = ('id', 'status', 'created_at', 'updated_at', 'message')
fields = ('id', 'status', 'created_at', 'updated_at', 'message', 'result')

def get_message(self, obj):
message = getattr(obj, 'message', None)
return message.asdict() if message else None

def get_result(self, obj):
message = getattr(obj, 'message', None)
try:
return message.get_result() if message else None
except Exception:
return None


class ScheduleJobSerializer(serializers.Serializer):
TRIGGER = None
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='dramatiq-tasks-manager',
version='0.0.9',
version='0.0.10',
packages=['dramatiq_tasks_manager',
'dramatiq_tasks_manager.management',
'dramatiq_tasks_manager.management.commands',
Expand Down

0 comments on commit 49caa9a

Please sign in to comment.