Skip to content

Commit

Permalink
enhanced admin ormq panel fix and schedules with broker_name
Browse files Browse the repository at this point in the history
  • Loading branch information
telmobarros committed Feb 6, 2021
1 parent 10df835 commit 1d6d996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions django_q/admin.py
Expand Up @@ -100,8 +100,7 @@ def has_add_permission(self, request):
"""Don't allow adds."""
return False

list_filter = ("key", "func")
search_fields = ("name", "func")
list_filter = ("key",)


admin.site.register(Schedule, ScheduleAdmin)
Expand Down
7 changes: 6 additions & 1 deletion django_q/cluster.py
Expand Up @@ -633,7 +633,12 @@ def scheduler(broker: Broker = None):
)
s.repeats += -1
# send it to the cluster
q_options["broker"] = broker
scheduled_broker = broker
try:
scheduled_broker = get_broker(q_options["broker_name"])
except: # invalid broker_name or non existing broker with broker_name
pass
q_options["broker"] = scheduled_broker
q_options["group"] = q_options.get("group", s.name or s.id)
kwargs["q_options"] = q_options
s.task = django_q.tasks.async_task(s.func, *args, **kwargs)
Expand Down

0 comments on commit 1d6d996

Please sign in to comment.