-
Notifications
You must be signed in to change notification settings - Fork 132
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
2006 trigger error on url in xform title #2007
Conversation
e28c0ae
to
e7c43c4
Compare
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.
LGTM, just a few suggestions
onadata/apps/logger/models/xform.py
Outdated
|
||
if re.match(pattern, self.title): | ||
raise XLSFormError( | ||
_("Invalid title value; shouldn't matches a url")) |
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.
_("Invalid title value; shouldn't matches a url")) | |
_("Invalid title value; value shouldn't match a URL")) |
onadata/apps/logger/models/xform.py
Outdated
@@ -818,6 +818,13 @@ def _set_title(self): | |||
_("Title shouldn't have any invalid xml " | |||
"characters ('>' '&' '<')")) | |||
|
|||
pattern = str("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|" |
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.
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.
Yes we should. Let me update
d1eaa24
to
94868a7
Compare
Signed-off-by: Mark Ekisa <[email protected]>
Co-authored-by: Mark Ekisa <[email protected]>
94868a7
to
14b0c2c
Compare
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.
LGTM
Changes / Features implemented
Trigger error when xform title matches a url
Steps taken to verify this change does what is intended
Added a test to check that an error is triggered when xform title matches a url
Side effects of implementing this change
Closes #2006