Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round Brackets don't work when using single check #149

Open
shivamkhosla opened this issue Sep 30, 2019 · 3 comments
Open

Round Brackets don't work when using single check #149

shivamkhosla opened this issue Sep 30, 2019 · 3 comments

Comments

@shivamkhosla
Copy link

WATCHMAN_CHECKS = (
'xyxy.health.xyxy_check'
)
If I have a single check like the above, WATCHMAN_CHECKS variable is taken as a string and thus when frozenset is applied in get_checks method, the output is a set of characters and thus I get the below error in import_string method:-
{"error": 500, "message": "h doesn't look like a module path"}
This problem doesn't occur when there are multiple checks.
If I change the round brackets to square brackets, It works in every case since it takes the input of WATCHMAN_CHECKS as an array.
I think the documentation needs to be changed because this warning has to be added

@ulgens
Copy link

ulgens commented Sep 30, 2019

("foo.bar") is not a valid iterable for Python. It's same as "foo.bar". For tuples, correct syntax should be ("foo.bar", ). ["foo.bar"] is a valid list but ("foo.bar") is not a tuple. I think this has nothing with django-watchman.

  • Edit: It's an itarable, sorry. But it's a string and iteration will be ["f", "o", "o"...]

@shivamkhosla
Copy link
Author

Yes @ulgens you are correct. This has nothing to do with Django-watchman. But this deserves a place in the documentation.

@stale
Copy link

stale bot commented Nov 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 29, 2019
@stale stale bot removed the stale label Dec 1, 2019
@stale stale bot removed the stale label Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants