summaryrefslogtreecommitdiffstats
path: root/lib/Controller/PollController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-08-26 16:30:41 +0200
committerJoas Schilling <coding@schilljs.com>2022-08-26 16:30:41 +0200
commit9ddae531db6f80df958ff9a263e08ebf3a990bf0 (patch)
treef048e2cb62c80b0f217ea96157eeff85837f0876 /lib/Controller/PollController.php
parent46a2326c799a5fd876bbe0c65a74a206749823f7 (diff)
Don't allow to close polls twice
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PollController.php')
-rw-r--r--lib/Controller/PollController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php
index 3d89ad5c9..5b0c183dc 100644
--- a/lib/Controller/PollController.php
+++ b/lib/Controller/PollController.php
@@ -202,6 +202,10 @@ class PollController extends AEnvironmentAwareController {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
+ if ($poll->getStatus() === Poll::STATUS_CLOSED) {
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
+ }
+
$poll->setStatus(Poll::STATUS_CLOSED);
try {