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

possible error with the /add route , throws internal server error #882

Merged
merged 8 commits into from
Mar 29, 2024

Conversation

RasenRhino
Copy link
Contributor

@RasenRhino RasenRhino commented Mar 27, 2024

Fixes issue #883
So if you write a custom module and you don't add your doc string, the info key in the KartonBind object is empty and hence when we try to access the /add route to add new targets, the method dedent and render_markdown in template.py throw an exception. This error was realised while I was writing custom modules and didn't bother to add the doc string. The line of interest in the jinja template where the input is piped to these methods is this.
A simple check should solve the issue.

@@ -17,10 +17,14 @@


def dedent(text: str) -> str:
if(text==None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not text.

BTW, please run linter (according to https://github.com/cert-polska/artemis?tab=readme-ov-file#code-formatting)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done so.

@kazet kazet merged commit 2b5eedc into CERT-Polska:main Mar 29, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants