django-watchman
django-watchman copied to clipboard
Fix HTML ids
Add optional id for check to use in HTML template, else slugify check name to avoid silent modal popup crash.
@jbenua thanks for the submission!
The reformatting makes it a little tricky to review the logical change here - could you split those out into a separate commit?
Could you also clarify the cases where the current configuration is causing a problem for you? Is this for some of the built-in checks or for custom checks that you're writing?
Thanks!
Hi!
yeah, custom checks, e.g. ping redis instances - titles are host:port values, and none of dots(.) or colons (:) are allowed in html ids.
Coverage remained the same at 90.975% when pulling 3267ab7809ed53476e959c86a63c3c122ed8e754 on jbenua:html-ids-fix into 445a5af0d80dbea89a3df602a2f6ecfb5af85913 on mwarkentin:master.
Could you add an example of setting a check ID to the custom checks readme as well?
I'm curious - are there places where slugify on its own wouldn't be enough and you'd need to override with your own id?
Imagine a situation when you have several very alike urls, for example 127.0.0.11:80 and 127.0.0.1:180:) slugify will generate the same string from them:
>>> slugify("127.0.0.11:80")
'127001180'
>>> slugify("127.0.0.1:180")
'127001180'
Cool, thanks :)
@jbenua looks like my CI on travis isn't working anymore, going to need to look into that before I do a full release. If it's helpful I could put out a pre-release on pypi that you could use if this is urgent for you.
No need to hurry:)
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.
Not stale.
@jbenua really sorry.. a little (lot) slower than I'd hoped, but I'm starting to prep a release of django-watchman, and I was wondering if you're still interested in getting this change merged and released?
Not really, but i hope it helps others.
@jbenua Sounds good, thanks again!