Skip to content

Commit

Permalink
set sqla_session on marshmallow schemas
Browse files Browse the repository at this point in the history
Following advice from the internet to avoid flaky errors we're seeing
occasionally in our unit tests[^1]

[^1]: marshmallow-code/flask-marshmallow#44 (comment)
  • Loading branch information
leohemsted committed May 22, 2024
1 parent 7da8296 commit 0d50876
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)

import app.constants
from app import ma, models
from app import db, ma, models
from app.dao.permissions_dao import permission_dao
from app.models import ServicePermission
from app.notifications.validators import remap_phone_number_validation_messages
Expand Down Expand Up @@ -71,6 +71,7 @@ class Meta:
load_instance = True
include_relationships = True
unknown = EXCLUDE
sqla_session = db.session

def __init__(self, load_json=False, *args, **kwargs):
self.load_json = load_json
Expand Down

0 comments on commit 0d50876

Please sign in to comment.