The regex to validate uuids was not rejecting uuids with a space at the end.

Switched to using a isinstance check on the string.
Added an order by clause to dao_get_template_usage_stats_by_service, it was causing an itermitten failure in the tests.
This commit is contained in:
Rebecca Law
2018-02-15 13:34:06 +00:00
parent de11751919
commit 52bf6dabcd
4 changed files with 35 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
from notifications_utils.statsd_decorators import statsd
from sqlalchemy import or_, and_
from sqlalchemy import or_, and_, desc
from app import db
from app.dao.dao_utils import transactional
@@ -54,4 +54,6 @@ def dao_get_template_usage_stats_by_service(service_id, year):
StatsTemplateUsageByMonth.year == year + 1
)
)
).order_by(
desc(StatsTemplateUsageByMonth.month)
).all()