-
Notifications
You must be signed in to change notification settings - Fork 27
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
Don't accept result values with . #2303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment inline.
Also do we never want decimals when excepting number input using DCNumberInput
? It sounds quite general purpose to me. Would we ever be expecting percentages/proportions to be entered with it?
ynr/apps/utils/widgets.py
Outdated
@@ -43,7 +43,7 @@ def build_attrs(self, base_attrs, extra_attrs=None): | |||
attrs.update( | |||
{ | |||
"inputmode": "numeric", | |||
"pattern": r"[0-9\s\.,]*", | |||
"pattern": r"[0-9\s\,]*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backslash (\
) is the escape character for regex, except you don't need to escape ,
so I'm not sure if it's doing anything - this makes it confusing. It was in front of .
because .
is a wildcard in regex, but I'm not sure even that was necessary when enclosed in square brackets...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed this up as suggested.
@pmk01 ^^ could you comment? I personally think accepting it and trying to figure out if it's the same context and mentioned in the issue vs a percentage and cleaning it could get tricky. |
We never want decimals (well, we might if we add other electoral systems, but right now, no). We don't want people to add percentages either. |
ee09bf2
to
6dee736
Compare
@VirginiaDooley This is good, but based on the decimal point, can you rename this field to |
6dee736
to
7b6c43d
Compare
Closes #2300