Improve error message

This commit is contained in:
Son NK 2020-01-05 21:14:40 +01:00
parent deba806d0f
commit c6db8db4a1
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ from flask import jsonify, request
from flask_cors import cross_origin
from app.api.base import api_bp, verify_api_key
from app.config import EMAIL_DOMAIN
from app.config import EMAIL_DOMAIN, MAX_NB_EMAIL_FREE_PLAN
from app.extensions import db
from app.log import LOG
from app.models import GenEmail, AliasUsedOn
@ -31,7 +31,7 @@ def new_custom_alias():
return (
jsonify(
error="You have reached the limitation of a free account with the maximum of "
"3 custom aliases, please upgrade your plan to create more custom aliases"
f"{MAX_NB_EMAIL_FREE_PLAN} aliases, please upgrade your plan to create more aliases"
),
400,
)

View File

@ -48,5 +48,5 @@ def test_out_of_quota(flask_client):
assert r.status_code == 400
assert r.json == {
"error": "You have reached the limitation of a free account with the maximum of 3 custom aliases, please upgrade your plan to create more custom aliases"
"error": "You have reached the limitation of a free account with the maximum of 3 aliases, please upgrade your plan to create more aliases"
}