jeancochrane / jeancochrane/pytest-flask-sqlalchemy

Instance XXX has been deleted. Use the make_transient() function to send this object back to the transient state. Again.

Open
#25 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
253
Forks
45
PR merge metrics
No merged PRs in 30d

Description

just like in #5 this happens again with latest versions, unfortunately #6 did not resolve this completely.

When I delete an object via a client call I receive the notorious error:
```
self =
state =
revert_deletion = False

def _update_impl(self, state, revert_deletion=False):
if state.key is None:
raise sa_exc.InvalidRequestError(
"Instance '%s' is not persisted" % state_str(state)
)

if state._deleted:
if revert_deletion:
if not state._attached:
return
del state._deleted
else:
raise sa_exc.InvalidRequestError(
"Instance '%s' has been deleted. "
"Use the make_transient() "
"function to send this object back "
> "to the transient state." % state_str(state)
)
E sqlalchemy.exc.InvalidRequestError: Instance '' has been deleted. Use the make_transient() function to send this object back to the transient state.
```

```
flask-sqlalchemy==2.4.1
pytest-flask-sqlalchemy==1.0.2
sqlalchemy==1.3.11
sqlalchemy-continuum==1.3.9
sqlalchemy-utils==0.36.0
```

@jeancochrane could you please have a look at it?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.