Return error when width or height are not set as integers (#61)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from api.models.external_print_product import get_cheapest_canvas_product, get_cheapest_poster_product
|
from api.models.external_print_product import get_cheapest_canvas_product, get_cheapest_poster_product
|
||||||
from flask import Blueprint, request, jsonify
|
from flask import Blueprint, request, jsonify
|
||||||
from api.helpers import check_api_key
|
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 (
|
from api.models import (
|
||||||
Inquiry,
|
Inquiry,
|
||||||
Market,
|
Market,
|
||||||
@@ -49,6 +49,9 @@ def wallpaper():
|
|||||||
designer = get_designer()
|
designer = get_designer()
|
||||||
reseller = get_reseller()
|
reseller = get_reseller()
|
||||||
|
|
||||||
|
if width is None or height is None:
|
||||||
|
raise ValidationError("width and height must be integers")
|
||||||
|
|
||||||
materials = Material.query.wallpapers().all()
|
materials = Material.query.wallpapers().all()
|
||||||
data = []
|
data = []
|
||||||
for material in materials:
|
for material in materials:
|
||||||
|
|||||||
Reference in New Issue
Block a user