]> WPIA git - gigi.git/commitdiff
chg: restructure code for better readability
authorINOPIAE <m.maengel@inopiae.de>
Thu, 15 Feb 2018 10:38:52 +0000 (11:38 +0100)
committerINOPIAE <m.maengel@inopiae.de>
Fri, 16 Feb 2018 07:40:32 +0000 (08:40 +0100)
Change-Id: If161d9176ac23edc0c5f19524c0dc2a157443ba2

src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java

index aaa4a43ae990ce1cccc8aa7662669c497bd05123..7445c52c54946cc87c00c02780aebdefeef88f20 100644 (file)
@@ -46,7 +46,13 @@ public class SupportUserDetailsForm extends Form {
             throw new GigiApiException("No ticket number set.");
         }
 
-        if ((req.getParameter("detailupdate") != null ? 1 : 0) + (req.getParameter("addGroup") != null ? 1 : 0) + (req.getParameter("removeGroup") != null ? 1 : 0) + (req.getParameter("resetPass") != null ? 1 : 0) != 1) {
+        int numActions = 0;
+        numActions += req.getParameter("detailupdate") != null ? 1 : 0;
+        numActions += req.getParameter("addGroup") != null ? 1 : 0;
+        numActions += req.getParameter("removeGroup") != null ? 1 : 0;
+        numActions += req.getParameter("resetPass") != null ? 1 : 0;
+
+        if (numActions != 1) {
             throw new GigiApiException("More than one action requested!");
         }