Updated count of deleted records
--- a/ckanext/ga_report/ga_model.py
+++ b/ckanext/ga_report/ga_model.py
@@ -168,12 +168,11 @@
count = model.Session.query(GA_Url).\
filter(GA_Url.period_name == 'All').count()
log.debug("Deleting %d 'All' records" % count)
- model.Session.query(GA_Url).\
+ count = model.Session.query(GA_Url).\
filter(GA_Url.period_name == 'All').delete()
- log.debug("Query: %s" % model.Session.query(GA_Url).
- filter(GA_Url.period_name == 'All'))
-
- model.Session.clufhs()
+ log.debug("Deleted %d 'All' records" % count)
+
+ model.Session.flush()
model.Session.commit()
model.repo.commit_and_remove()