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

Error while trying to go to the add target page (/add route) after adding a new module. #883

Closed
RasenRhino opened this issue Mar 27, 2024 · 4 comments

Comments

@RasenRhino
Copy link
Contributor

RasenRhino commented Mar 27, 2024

Error:

artemis-web-1                                  |   File "/opt/templates/add.jinja2", line 74, in block 'main'
artemis-web-1                                  |     <span class="small text-muted">{{ bind.info|dedent|render_markdown|safe }}</span>
artemis-web-1                                  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
artemis-web-1                                  |   File "/opt/artemis/templating.py", line 20, in dedent
artemis-web-1                                  |     return textwrap.dedent(text)
artemis-web-1                                  |            ^^^^^^^^^^^^^^^^^^^^^
artemis-web-1                                  |   File "/usr/local/lib/python3.11/textwrap.py", line 435, in dedent
artemis-web-1                                  |     text = _whitespace_only_re.sub('', text)
artemis-web-1                                  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
artemis-web-1                                  | TypeError: expected string or bytes-like object, got 'NoneType'

Steps to replicate:

The easiest way to replicate this would be just removing the docstring from a module. you can remove it from the this module.
Adding the docstring solves the error.

@kazet
Copy link
Member

kazet commented Mar 28, 2024

Wanna fix this? IMO a good direction would be to support empty docstrings, not expecting them but failing in a more clean way.

@RasenRhino
Copy link
Contributor Author

got it, thank you @kazet I will get to it.

@RasenRhino
Copy link
Contributor Author

@kazet so , you want that if there is no docstring, it should throw an error rather than crashing ?

@kazet
Copy link
Member

kazet commented Mar 29, 2024

What you implemented (that in case of no docstring just nothing appears) is OK!

@kazet kazet closed this as completed Mar 29, 2024
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

No branches or pull requests

2 participants