Skip to content

Commit a1e0652

Browse files
committed
Fixed wrong orientation/gender error
1 parent ac2d6a9 commit a1e0652

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

backend/PyMatcha/routes/api/profile/complete.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def complete_profile():
6262
if len(tags) != len(set(tags)):
6363
raise BadRequestError("Duplicate tags.")
6464

65+
if orientation not in ["heterosexual", "homosexual", "bisexual", "other"]:
66+
raise BadRequestError("Orientation must be one of 'heterosexual', 'homosexual', 'bisexual', 'other'")
67+
68+
if gender not in ["male", "female", "other"]:
69+
raise BadRequestError("Gender must be one of 'male', 'female', 'other'")
70+
6571
today = datetime.datetime.utcnow()
6672

6773
age = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month, birthdate.day))

0 commit comments

Comments
 (0)