mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Working tests and provider stats table.
Fix for tests and import error. Added tests and updated for code review comments.
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
import uuid
|
||||
from app import db
|
||||
from app.models import (Template, Service)
|
||||
from sqlalchemy import asc
|
||||
|
||||
from app.dao.dao_utils import (
|
||||
transactional,
|
||||
version_class
|
||||
)
|
||||
|
||||
|
||||
@transactional
|
||||
@version_class(Template)
|
||||
def dao_create_template(template):
|
||||
template.id = uuid.uuid4() # must be set now so version history model can use same id
|
||||
db.session.add(template)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
@transactional
|
||||
@version_class(Template)
|
||||
def dao_update_template(template):
|
||||
db.session.add(template)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def dao_get_template_by_id_and_service_id(template_id, service_id):
|
||||
|
||||
Reference in New Issue
Block a user