You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one of those late night questions so forgive me if I'm missing something obvious. I'm getting an error of this type:
TransactionManagementError at /admin/djstripe/apikey/add/
An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
The pghistory context injection is included in the traceback and I was curious if there was an easy way to disable the context injection or pghistory in general?
/usr/local/lib/python3.10/site-packages/pghistory/runtime.py, line 51, in _inject_history_context is going off before self.db.validate_no_broken_transaction() in /django/db/backends/utils.py
File "/usr/local/lib/python3.10/site-packages/pghistory/core.py", line 656, in _model_wrapper
create_event_model(
File "/usr/local/lib/python3.10/site-packages/pghistory/core.py", line 516, in create_event_model
context_field = _get_context_field(context_field=context_field, context_fk=context_fk)
File "/usr/local/lib/python3.10/site-packages/pghistory/core.py", line 399, in _get_context_field
context_field = config.context_field()
File "/usr/local/lib/python3.10/site-packages/pghistory/config.py", line 70, in context_field
assert isinstance(context_field, (ContextForeignKey, ContextJSONField))
The text was updated successfully, but these errors were encountered:
@jzmiller1 sorry for the delay on this. This issue should be fixed in #95 when deployed. I now check for an errored transaction before setting context in the SQL.
The SQL variable injection is quite complex. I use this approach in a few libraries too. I'm planning to break up this SQL injection into its own library and then allow users to better configure its behavior (i.e. instead of injecting variables into the SQL, you can tell it to just issue separate SQL commands to set the variables if you don't care about extra queries).
This is one of those late night questions so forgive me if I'm missing something obvious. I'm getting an error of this type:
TransactionManagementError at /admin/djstripe/apikey/add/
An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
The pghistory context injection is included in the traceback and I was curious if there was an easy way to disable the context injection or pghistory in general?
/usr/local/lib/python3.10/site-packages/pghistory/runtime.py, line 51, in _inject_history_context is going off before self.db.validate_no_broken_transaction() in /django/db/backends/utils.py
I attempted following the suggestion in https://django-pghistory.readthedocs.io/en/2.5.1/performance.html about setting settings.PGHISTORY_CONTEXT_FIELD to None but bumped into some issues on that path as well:
The text was updated successfully, but these errors were encountered: