Changeset b14789a in rattail


Ignore:
Timestamp:
07/28/2020 08:30:56 PM (3 years ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
11a1c8c
Parents:
65330c5c
Message:

Tweak logic for purging batches to avoid warnings, duplicate progress

must make sure the row is "detached" from the batch before deleting it,
otherwise SQLAlchemy warns about incorrect number of rows being deleted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail/batch/handlers.py

    r65330c5c rb14789a  
    214214
    215215        def purge(batch, i):
    216             self.delete(batch, delete_all_data=delete_all_data, progress=progress)
     216            self.delete(batch, delete_all_data=delete_all_data)
    217217            session.delete(batch)
    218218            result.purged += 1
     
    733733
    734734            def delete(row, i):
     735                batch.data_rows.remove(row)
    735736                session.delete(row)
    736737                if i % 200 == 0:
Note: See TracChangeset for help on using the changeset viewer.