Skip to content

Commit 114c90c

Browse files
committed
fix: notification features are not set in case of form validation errors
reason: if result.hasErrors(), we use setTags(..) method to set some basic attributes. it was missing there.
1 parent 88695f4 commit 114c90c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/de/rwth/idsg/steve/web/controller/UsersController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public String getDetails(@PathVariable("userPk") int userPk, Model model) {
9393
UserForm form = UserFormMapper.toForm(details);
9494

9595
model.addAttribute("userForm", form);
96-
model.addAttribute("features", NotificationFeature.getUserValues());
9796
setTags(model, form.getIdTagList());
9897
return "data-man/userDetails";
9998
}
@@ -102,7 +101,6 @@ public String getDetails(@PathVariable("userPk") int userPk, Model model) {
102101
public String addGet(Model model) {
103102
setTags(model, List.of());
104103
model.addAttribute("userForm", new UserForm());
105-
model.addAttribute("features", NotificationFeature.getUserValues());
106104
return "data-man/userAdd";
107105
}
108106

@@ -146,6 +144,7 @@ private void setTags(Model model, List<String> idTagsFromUser) {
146144

147145
model.addAttribute("countryCodes", ControllerHelper.COUNTRY_DROPDOWN);
148146
model.addAttribute("idTagList", idTagList);
147+
model.addAttribute("features", NotificationFeature.getUserValues());
149148
}
150149

151150
// -------------------------------------------------------------------------

0 commit comments

Comments
 (0)