mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Rename database management functions.
Rename @transactional to @autocommit. Rename nested_transaction to tranaction.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from app import db
|
||||
from app.dao.dao_utils import transactional
|
||||
from app.dao.dao_utils import autocommit
|
||||
from app.models import InboundNumber
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ def dao_get_inbound_number(inbound_number_id):
|
||||
return InboundNumber.query.filter(InboundNumber.id == inbound_number_id).first()
|
||||
|
||||
|
||||
@transactional
|
||||
@autocommit
|
||||
def dao_set_inbound_number_to_service(service_id, inbound_number):
|
||||
inbound_number.service_id = service_id
|
||||
db.session.add(inbound_number)
|
||||
|
||||
|
||||
@transactional
|
||||
@autocommit
|
||||
def dao_set_inbound_number_active_flag(service_id, active):
|
||||
inbound_number = InboundNumber.query.filter(InboundNumber.service_id == service_id).first()
|
||||
inbound_number.active = active
|
||||
@@ -33,7 +33,7 @@ def dao_set_inbound_number_active_flag(service_id, active):
|
||||
db.session.add(inbound_number)
|
||||
|
||||
|
||||
@transactional
|
||||
@autocommit
|
||||
def dao_allocate_number_for_service(service_id, inbound_number_id):
|
||||
updated = InboundNumber.query.filter_by(
|
||||
id=inbound_number_id,
|
||||
|
||||
Reference in New Issue
Block a user