Skip to content

Commit 3e6a392

Browse files
committed
make user.sex an optional field
defaults to "other" if not set
1 parent 114c90c commit 3e6a392

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/de/rwth/idsg/steve/web/dto/UserForm.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ public class UserForm {
5151
private LocalDate birthDay;
5252
private String phone;
5353
private String note;
54-
55-
@NotNull(message = "Sex is required")
56-
private UserSex sex;
54+
private UserSex sex = UserSex.OTHER;
5755

5856
@Email(message = "Not a valid e-mail address")
5957
private String eMail;
@@ -77,4 +75,7 @@ public boolean isNotificationFeaturesForUser() {
7775
return true;
7876
}
7977

78+
public void setSex(UserSex sex) {
79+
this.sex = (sex == null) ? UserSex.OTHER : sex;
80+
}
8081
}

0 commit comments

Comments
 (0)