From 6ee9c719025f954bfc996f11b4a89219f635a17f Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 14 Aug 2011 07:55:08 -0500 Subject: [PATCH] Method to get the failure exception object for a MediaEntry, if appropriate. --- mediagoblin/db/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 982883d7..b6e52441 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -297,6 +297,13 @@ class MediaEntry(Document): def uploader(self): return self.db.User.find_one({'_id': self['uploader']}) + def get_fail_exception(self): + """ + Get the exception that's appropriate for this error + """ + if self['fail_error']: + return util.import_component(self['fail_error']) + class MediaComment(Document): """ -- 2.25.1