[ckan-changes] commit/ckanext-admin: rgrp: [trash][xs]: put try/except around purging so we don't 500 if some purge fails.

Bitbucket commits-noreply at bitbucket.org
Sun Jun 12 14:30:32 UTC 2011


1 new changeset in ckanext-admin:

http://bitbucket.org/okfn/ckanext-admin/changeset/1934342eae69/
changeset:   1934342eae69
user:        rgrp
date:        2011-06-12 16:30:26
summary:     [trash][xs]: put try/except around purging so we don't 500 if some purge fails.
affected #:  1 file (203 bytes)

--- a/ckanext/admin/controller.py	Fri Apr 29 08:53:32 2011 +0100
+++ b/ckanext/admin/controller.py	Sun Jun 12 14:30:26 2011 +0000
@@ -279,7 +279,12 @@
             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)

Repository URL: https://bitbucket.org/okfn/ckanext-admin/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list