"""Handle any GET request."""
try:
self._init_handling()
- if self.site in {'calendar', 'day', 'process', 'process_titles',
- 'process_descriptions', 'process_efforts',
- 'processes', 'todo', 'condition',
- 'condition_titles', 'condition_descriptions',
- 'conditions'}:
+ if hasattr(self, f'do_GET_{self.site}'):
template = f'{self.site}.html'
ctx = getattr(self, f'do_GET_{self.site}')()
html = self.server.jinja.get_template(template).render(**ctx)
postvars = parse_qs(self.rfile.read(length).decode(),
keep_blank_values=True, strict_parsing=True)
self.form_data = InputsParser(postvars)
- if self.site in ('day', 'process', 'todo', 'condition'):
+ if hasattr(self, f'do_POST_{self.site}'):
redir_target = getattr(self, f'do_POST_{self.site}')()
self.conn.commit()
else: