We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbc5f96 commit 2a7cf50Copy full SHA for 2a7cf50
backend/PyMatcha/routes/api/profile/images.py
@@ -29,9 +29,7 @@ def add_image_profile():
29
raise BadRequestError("No file passed in request")
30
if file:
31
if is_primary:
32
- try:
33
- Image.get_multi(user_id=current_user.id, is_primary=True)
34
- except ValueError:
+ if not Image.get_multi(user_id=current_user.id, is_primary=True):
35
# That means there was no primary image before
36
tmp_img = BytesIO()
37
file.save(tmp_img)
0 commit comments