From 049284b1da87c1fcb21a8b5585890364eb8e0735 Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 13 Dec 2011 10:49:51 +0100 Subject: [PATCH] Dot-Notation for MediaEntry.state --- mediagoblin/processing.py | 2 +- mediagoblin/tests/test_submission.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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') -- 2.25.1