aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-02-12 23:49:37 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-02-26 19:19:48 +0100
commit8efcd4055804f5dba99cced70fd4fb7876a88e5e (patch)
tree3ab6a0f8d0301748307e54476e30f5b09101bb93
parentec97c937b7e3374d40624478f805694b56bc0317 (diff)
downloadmediagoblin-8efcd4055804f5dba99cced70fd4fb7876a88e5e.tar.lz
mediagoblin-8efcd4055804f5dba99cced70fd4fb7876a88e5e.tar.xz
mediagoblin-8efcd4055804f5dba99cced70fd4fb7876a88e5e.zip
Dot-Notation: MediaComment and some random places
-rw-r--r--mediagoblin/tests/test_submission.py6
-rw-r--r--mediagoblin/user_pages/views.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py
index 217926a4..2f11bdfb 100644
--- a/mediagoblin/tests/test_submission.py
+++ b/mediagoblin/tests/test_submission.py
@@ -140,7 +140,7 @@ class TestSubmission:
context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/user_pages/user.html']
request = context['request']
media = request.db.MediaEntry.find({'title': 'Balanced Goblin'})[0]
- assert_equal(media['tags'],
+ assert_equal(media.tags,
[{'name': u'yin', 'slug': u'yin'},
{'name': u'yang', 'slug': u'yang'}])
@@ -255,7 +255,7 @@ class TestSubmission:
{'title': 'Malicious Upload 2'})
assert_equal(entry.state, 'failed')
assert_equal(
- entry['fail_error'],
+ entry.fail_error,
u'mediagoblin.processing:BadMediaFail')
# Test non-supported file with .png extension
@@ -275,5 +275,5 @@ class TestSubmission:
{'title': 'Malicious Upload 3'})
assert_equal(entry.state, 'failed')
assert_equal(
- entry['fail_error'],
+ entry.fail_error,
u'mediagoblin.processing:BadMediaFail')
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 05d07b1b..530dea64 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -142,11 +142,11 @@ def media_post_comment(request, media):
assert request.method == 'POST'
comment = request.db.MediaComment()
- comment['media_entry'] = media._id
- comment['author'] = request.user._id
- comment['content'] = unicode(request.POST['comment_content'])
+ comment.media_entry = media.id
+ comment.author = request.user.id
+ comment.content = unicode(request.POST['comment_content'])
- if not comment['content'].strip():
+ if not comment.content.strip():
messages.add_message(
request,
messages.ERROR,