From dbd21902fa1e698f5c9ef403bbad9070ee54a5d5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 3 Jul 2020 21:51:01 +0100 Subject: [PATCH] Get checkbox state --- daemon.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/daemon.py b/daemon.py index b226289a..ea9bd706 100644 --- a/daemon.py +++ b/daemon.py @@ -7661,19 +7661,22 @@ class PubServer(BaseHTTPRequestHandler): self.server.POSTbusy = False return if '&submitOnCalendar=' in optionsConfirmParams: - if fields.get('onCalendar'): - if fields['onCalendar'] == 'on': - addPersonToCalendar(self.server.baseDir, - chooserNickname, - self.server.domain, - optionsNickname, - optionsDomainFull) - else: - removePersonFromCalendar(self.server.baseDir, - chooserNickname, - self.server.domain, - optionsNickname, - optionsDomainFull) + onCalendar = optionsConfirmParams.split('onCalendar=')[1] + if '&' in onCalendar: + onCalendar = onCalendar.split('&')[0] + print('onCalendar: ' + onCalendar) + if onCalendar == 'on': + addPersonToCalendar(self.server.baseDir, + chooserNickname, + self.server.domain, + optionsNickname, + optionsDomainFull) + else: + removePersonFromCalendar(self.server.baseDir, + chooserNickname, + self.server.domain, + optionsNickname, + optionsDomainFull) self._redirect_headers(originPathStr + '/' + self.server.defaultTimeline + '?page='+str(pageNumber), cookie,