Return error when width or height are not set as integers (#61)

This commit is contained in:
Niklas Fondberg
2022-06-10 09:30:45 +02:00
committed by GitHub
parent 6ed7d825bd
commit 934537f0b9
+4 -1
View File
@@ -1,7 +1,7 @@
from api.models.external_print_product import get_cheapest_canvas_product, get_cheapest_poster_product
from flask import Blueprint, request, jsonify
from api.helpers import check_api_key
from api.validators import validate_number, validate_exists
from api.validators import ValidationError, validate_number, validate_exists
from api.models import (
Inquiry,
Market,
@@ -49,6 +49,9 @@ def wallpaper():
designer = get_designer()
reseller = get_reseller()
if width is None or height is None:
raise ValidationError("width and height must be integers")
materials = Material.query.wallpapers().all()
data = []
for material in materials: