Skip to content

Commit

Permalink
set autocommit depending on request context
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaxxl committed Sep 14, 2024
1 parent fbcd493 commit e533a21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion safrs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class SAFRSBase(Model):
(or should have, hindsight is great :/) the distinguishing `_s_` prefix
"""

db_commit = True # commit instances automatically, see also _s_auto_commit property below
db_commit = has_request_context() # commit instances automatically, see also _s_auto_commit property below
url_prefix = ""
allow_client_generated_ids = False # Indicates whether the client is allowed to create the id
exclude_attrs = [] # list of attribute names that should not be serialized
Expand Down

0 comments on commit e533a21

Please sign in to comment.