Skip to content

Commit

Permalink
Update app/api/views/alias.py
Browse files Browse the repository at this point in the history
Co-authored-by: Adrià Casajús <[email protected]>
  • Loading branch information
cquintana92 and acasajus authored Dec 2, 2024
1 parent 99ade0f commit 55af223
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/api/views/alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,10 @@ def update_alias(alias_id):
changed = True

if "mailbox_ids" in data:
mailbox_ids = []
for mailbox_id in data.get("mailbox_ids"):
try:
mailbox_ids.append(int(mailbox_id))
except ValueError:
return jsonify(error="Invalid mailbox_id"), 400

try:
mailbox_ids = [int(m_id) for m_id in data.get("mailbox_ids")]
except ValueError:
return jsonify(error="Invalid mailbox_id"), 400
err = set_mailboxes_for_alias(
user_id=user.id, alias=alias, mailbox_ids=mailbox_ids
)
Expand Down

0 comments on commit 55af223

Please sign in to comment.