create, edit and use email branding instead of organisation

notable things that have been kept until migration is complete:

* passing in `organisation` to update_service will update email branding
* both `/email-branding` and `/organisation` hit the same code
* service endpoints still return organisation as well as email branding
This commit is contained in:
Leo Hemsted
2018-02-06 11:23:34 +00:00
parent cea52929d3
commit 2f79da8702
18 changed files with 281 additions and 279 deletions
+23
View File
@@ -0,0 +1,23 @@
from app import db
from app.dao.dao_utils import transactional
from app.models import EmailBranding
def dao_get_email_branding_options():
return EmailBranding.query.all()
def dao_get_email_branding_by_id(email_branding_id):
return EmailBranding.query.filter_by(id=email_branding_id).one()
@transactional
def dao_create_email_branding(email_branding):
db.session.add(email_branding)
@transactional
def dao_update_email_branding(email_branding, **kwargs):
for key, value in kwargs.items():
setattr(email_branding, key, value)
db.session.add(email_branding)