empty dictionary as configuration value for SQS

The [documentation](https://django-q.readthedocs.io/en/latest/configure.html#sqs-configuration) lists all keys as optional, but the way `get_broker` is implemented it will evaluate to false and return Redis. One way around this would be checking if the type of `Conf.SQS` is `dict`.
This commit is contained in:
Timo Zimmermann
2020-09-22 15:42:38 +02:00
parent 7b4c357128
commit 73ca8edcf5

View File

@@ -176,7 +176,7 @@ def get_broker(list_key: str = Conf.PREFIX) -> Broker:
return ironmq.IronMQBroker(list_key=list_key)
# SQS
elif Conf.SQS:
elif type(Conf.SQS) == dict:
from django_q.brokers import aws_sqs
return aws_sqs.Sqs(list_key=list_key)