From: Elrond Date: Tue, 13 Dec 2011 09:49:51 +0000 (+0100) Subject: Dot-Notation for MediaEntry.state X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=049284b1da87c1fcb21a8b5585890364eb8e0735;p=mediagoblin.git Dot-Notation for MediaEntry.state --- diff --git a/mediagoblin/processing.py b/mediagoblin/processing.py index 7dd5cc7d..cbac8030 100644 --- a/mediagoblin/processing.py +++ b/mediagoblin/processing.py @@ -64,7 +64,7 @@ class ProcessMedia(Task): except ImportError, exc: mark_entry_failed(entry[u'_id'], exc) - entry['state'] = u'processed' + entry.state = u'processed' entry.save() def on_failure(self, exc, task_id, args, kwargs, einfo): diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py index 4a0543a8..2b17c515 100644 --- a/mediagoblin/tests/test_submission.py +++ b/mediagoblin/tests/test_submission.py @@ -240,7 +240,7 @@ class TestSubmission: entry = mg_globals.database.MediaEntry.find_one( {'title': 'Malicious Upload 2'}) - assert_equal(entry['state'], 'failed') + assert_equal(entry.state, 'failed') assert_equal( entry['fail_error'], u'mediagoblin.processing:BadMediaFail') @@ -260,7 +260,7 @@ class TestSubmission: entry = mg_globals.database.MediaEntry.find_one( {'title': 'Malicious Upload 3'}) - assert_equal(entry['state'], 'failed') + assert_equal(entry.state, 'failed') assert_equal( entry['fail_error'], u'mediagoblin.processing:BadMediaFail')