diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-06 22:41:53 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-02-06 22:41:53 -0300 |
commit | 67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d (patch) | |
tree | 696749bdf7f49239afd948657dddd6504b5581b0 | |
parent | 22a600f7e328fdcc176cf7725dac78ea989d67fa (diff) | |
download | askbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.tar.gz askbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.tar.bz2 askbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.zip |
made test cases pass
-rw-r--r-- | askbot/models/post.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/askbot/models/post.py b/askbot/models/post.py index a029143a..2d9e7a88 100644 --- a/askbot/models/post.py +++ b/askbot/models/post.py @@ -206,15 +206,20 @@ class PostManager(BaseQuerySetManager): assert(post_type in const.POST_TYPES) - post = Post( - post_type = post_type, - thread = thread, - parent = parent, - author = author, - added_at = added_at, - wiki = wiki, - text = text, + if thread: language_code = thread.language_code + else: + language_code = get_language() + + post = Post( + post_type=post_type, + thread=thread, + parent=parent, + author=author, + added_at=added_at, + wiki=wiki, + text=text, + language_code=language_code #.html field is denormalized by the save() call ) |