Skip to content

Commit ce63b59

Browse files
committed
Fixed empty query error
1 parent 084e5f8 commit ce63b59

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/PyMatcha/utils/recommendations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def create_user_recommendations(user_to_update):
3030

3131
query = _get_gender_query(user_to_update.orientation, user_to_update.gender)
3232

33+
if not query:
34+
return
3335
for user in query:
3436
if user.id == user_to_update.id:
3537
continue

0 commit comments

Comments
 (0)