Closed fozcode closed 5 years ago
The code already has a line for this at data_manager.py line 1582 but it doesn't seem to be working.
The reordering routine used its own separate db session to keep the operation atomic, so while the returned object was correctly refreshed, the object already loaded in the outer db session was not being refreshed (until now).
The API
/api/v1/portfolios/[portfolio id]/images/[image id]/position/
does correctly set the value oforder_num
in the database, and does return the images in the correct order in the JSON, but the value oforder_num
in the JSON still contains the old value for the image that was moved.I suspect this is a case of SQLAlchemy session caching again, we need to refresh the portfolio-image object in the session. The code already has a line for this at data_manager.py line 1582 but it doesn't seem to be working.