return
else:
raise NotFoundException(f'Unknown page: /{site}')
- conn.close()
self._send_html(html)
except HandledException as error:
self._send_msg(error, code=error.http_code)
+ finally:
+ conn.close()
def do_GET_calendar(self, conn: DatabaseConnection,
params: ParamsParser) -> str:
else:
msg = f'Page not known as POST target: /{site}'
raise NotFoundException(msg)
- conn.close()
self._redirect('/')
except HandledException as error:
self._send_msg(error, code=error.http_code)
+ finally:
+ conn.close()
def do_POST_day(self, conn: DatabaseConnection, params: ParamsParser,
form_data: PostvarsParser) -> None: