simplify code

Wed, 13 May 2026 23:17:23 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 13 May 2026 23:17:23 +0200
changeset 421
3ffbf8bfdbd8
parent 420
88f62698e20c
child 422
fbc5851f8dd4

simplify code

relates to #833 and issue #834

src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Wed May 13 23:15:51 2026 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Wed May 13 23:17:23 2026 +0200
@@ -521,14 +521,14 @@
                 if (type != null) {
                     http.request.setAttribute("autoRelate", autoRelate)
                     // pick a useful category for the relation
-                    if (type.first == RelationType.Tests && type.second) {
-                        // tested by a Test
-                        issue.category = IssueCategory.Test
-                    } else if (type.first == RelationType.DefectOf && type.second) {
-                        // defect of a Bug
-                        issue.category = IssueCategory.Bug
-                    } else if (type.first == RelationType.SubtaskOf && type.second) {
-                        issue.category = IssueCategory.Task
+                    if (type.second) {
+                        if (type.first == RelationType.Tests) {
+                            issue.category = IssueCategory.Test
+                        } else if (type.first == RelationType.DefectOf) {
+                            issue.category = IssueCategory.Bug
+                        } else if (type.first == RelationType.SubtaskOf) {
+                            issue.category = IssueCategory.Task
+                        }
                     }
                 }
             }

mercurial