summaryrefslogtreecommitdiffstats
path: root/askbot/models
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-02-06 22:41:53 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-02-06 22:41:53 -0300
commit67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d (patch)
tree696749bdf7f49239afd948657dddd6504b5581b0 /askbot/models
parent22a600f7e328fdcc176cf7725dac78ea989d67fa (diff)
downloadaskbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.tar.gz
askbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.tar.bz2
askbot-67b544d50d9ab311f0b0ec64872a2bdbe1d80f7d.zip
made test cases pass
Diffstat (limited to 'askbot/models')
-rw-r--r--askbot/models/post.py21
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
)