-
Notifications
You must be signed in to change notification settings - Fork 58
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
Intended to solve #494 #495
Conversation
BassCoder2808
commented
Jul 26, 2023
- Made the changes suggested by @vargenau and @goneall which will help better format the error messages and warnings we receive in the online tools.
- Solves HUGE warning for deprecated licences #494
Hi @BassCoder2808,
|
Minor update on the variable name
Hi @vargenau yes I just saw that the 3rd case had the |
Thank you @BassCoder2808 |
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.
Thanks @BassCoder2808 - just a minor suggested change to format the raw HTML a bit better
src/app/core.py
Outdated
@@ -221,7 +221,8 @@ def ntia_check_helper(request): | |||
""" If any warnings are returned """ | |||
if (request.is_ajax()): | |||
ajaxdict["type"] = "warning" | |||
ajaxdict["data"] = "The following warning(s) were raised:\n" + str(retval) | |||
warnings = str(retval) | |||
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />') |
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.
Just a nit - it would be nice to keep a linefeed in case anyone looks at the raw HTML.
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.
We could also have
"The following warning(s) were raised:<br />\n"
instead of:
"The following warning(s) were raised:\n"
so that the first warning is not on the same line.
src/app/core.py
Outdated
@@ -221,7 +221,8 @@ def ntia_check_helper(request): | |||
""" If any warnings are returned """ | |||
if (request.is_ajax()): | |||
ajaxdict["type"] = "warning" | |||
ajaxdict["data"] = "The following warning(s) were raised:\n" + str(retval) | |||
warnings = str(retval) | |||
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />') |
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.
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />') | |
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />\n') |
src/app/core.py
Outdated
@@ -327,7 +328,8 @@ def license_validate_helper(request): | |||
""" If any warnings are returned """ | |||
if (request.is_ajax()): | |||
ajaxdict["type"] = "warning" | |||
ajaxdict["data"] = "The following warning(s) were raised: " + str(retval) | |||
warnings = str(retval) | |||
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />') |
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.
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />') | |
ajaxdict["data"] = "The following warning(s) were raised:\n" + warnings.replace('\n', '<br />\n') |
src/app/core.py
Outdated
@@ -519,7 +521,8 @@ def license_convert_helper(request): | |||
else : | |||
if (request.is_ajax()): | |||
ajaxdict["type"] = "warning" | |||
ajaxdict["data"] = "The following warning(s) were raised by "+ myfile.name + ": " + str(warnings) | |||
warnings = str(warnings) | |||
ajaxdict["data"] = "The following warning(s) were raised by "+ myfile.name + ": " + warnings.replace('\n', '<br />') |
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.
ajaxdict["data"] = "The following warning(s) were raised by "+ myfile.name + ": " + warnings.replace('\n', '<br />') | |
ajaxdict["data"] = "The following warning(s) were raised by "+ myfile.name + ": " + warnings.replace('\n', '<br />\n') |
Hi @goneall I have made the changes, let me know if anything else needs to be changed |
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.
Thanks @BassCoder2808 and @vargenau