Commits

Anonymous committed 1934342

[trash][xs]: put try/except around purging so we don't 500 if some purge fails.

Comments (0)

Files changed (1)

ckanext/admin/controller.py

             revs_to_purge = list(set(revs_to_purge))
             for id in revs_to_purge:
                 revision = model.Session.query(model.Revision).get(id)
-                model.repo.purge_revision(revision, leave_record=False)
+                try:
+                    model.repo.purge_revision(revision, leave_record=False)
+                except Exception, inst:
+                    msg = 'Problem purging revision %s: %s' % (id,
+                            inst)
+                    msgs.append(msg)
             h.flash_success(_('Purge complete'))
             for msg in msgs:
                 h.flash_error(msg)