Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ server {

port_in_redirect off;

client_max_body_size 10m;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider adding a comment on why this change is made.


proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.1]

### Fixed

- Added error handling on syntax errors in templates.
- Bumped nginx max file size to 10mb.

## [0.1.0]

### Added
Expand All @@ -30,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.1.0...HEAD
[Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.1.1...HEAD
[0.1.1]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.1.1
[0.1.0]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.1.0
[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.0.1
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "OpenPostbud"
version = "0.1.0"
version = "0.1.1"
authors = [
{ name="Mathias Gammelgaard", email="ghbm@aarhus.dk" },
]
Expand Down
8 changes: 7 additions & 1 deletion src/OpenPostbud/routes/user/send_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from nicegui import ui, APIRouter, app
from nicegui import run as nicegui_run
from nicegui.events import UploadEventArguments
from jinja2.exceptions import TemplateSyntaxError

from OpenPostbud import ui_components
from OpenPostbud.middleware import authentication
Expand Down Expand Up @@ -161,7 +162,12 @@ async def _on_template_upload(self, e: UploadEventArguments):
self.template_bytes = await e.file.read()

if self.template_name.endswith(".docx"):
self.template_fields = docx_util.get_merge_fields(self.template_bytes)
try:
self.template_fields = docx_util.get_merge_fields(self.template_bytes)
except TemplateSyntaxError as error:
ui.notify(f"Syntaksfejl i skabelon: {error}", type="negative", timeout=0, actions=[{"label": "Luk", "color": "white"}])
self._remove_template()
raise
else:
self.template_fields = []

Expand Down
Loading
Loading