Skip to content

Commit

Permalink
fix: barcode should not be an empty str in webhook call
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Aug 11, 2023
1 parent 812450f commit a7b6472
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions robotoff/app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,11 @@ def on_post(self, req: falcon.Request, resp: falcon.Response):
title="invalid_action",
description="action must be one of " "`deleted`, `updated`",
)
if not barcode:
raise falcon.HTTPBadRequest(
title="invalid_barcode",
description="barcode should not be empty",
)

server_type = ServerType.get_from_server_domain(server_domain)
product_id = ProductIdentifier(barcode, server_type)
Expand Down

0 comments on commit a7b6472

Please sign in to comment.