summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-05-16 17:00:41 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-05-16 17:00:41 -0400
commit7cbf8cc4fc8e073145589ac9f6e12b00f81b286b (patch)
treeeeaecb4d1be097c3756d93a0993cd9d7a8f03b23
parent4cf3ec3998b1f067a7f0c76eae4a90c274024986 (diff)
parent81d64e494eeaf184d3dc7e6105b2815486e93053 (diff)
downloadaskbot-7cbf8cc4fc8e073145589ac9f6e12b00f81b286b.tar.gz
askbot-7cbf8cc4fc8e073145589ac9f6e12b00f81b286b.tar.bz2
askbot-7cbf8cc4fc8e073145589ac9f6e12b00f81b286b.zip
Merge branch 'user-groups'
-rw-r--r--askbot/lamson_handlers.py2
-rw-r--r--askbot/models/__init__.py1
-rw-r--r--askbot/models/post.py4
-rw-r--r--askbot/skins/common/media/js/post.js9
-rw-r--r--askbot/skins/default/media/style/style.less7
-rw-r--r--askbot/utils/decorators.py2
-rw-r--r--askbot/utils/mail.py2
-rw-r--r--askbot/views/commands.py2
-rw-r--r--askbot/views/writers.py5
9 files changed, 18 insertions, 16 deletions
diff --git a/askbot/lamson_handlers.py b/askbot/lamson_handlers.py
index 34f93a7b..9062594c 100644
--- a/askbot/lamson_handlers.py
+++ b/askbot/lamson_handlers.py
@@ -130,7 +130,7 @@ def ASK(message, host = None, addr = None):
try:
group_tag = Tag.group_tags.get(
deleted = False,
- name_iexact = addr
+ name__iexact = addr
)
mail.process_emailed_question(
from_address, subject, parts, tags = [group_tag.name, ]
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index 3eca3c0e..5e41a07a 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -1420,6 +1420,7 @@ def user_edit_comment(
edited_by = self,
by_email = by_email
)
+ comment_post.thread.invalidate_cached_data()
def user_edit_post(self,
post = None,
diff --git a/askbot/models/post.py b/askbot/models/post.py
index daf7757b..a0fdc4ff 100644
--- a/askbot/models/post.py
+++ b/askbot/models/post.py
@@ -1743,8 +1743,8 @@ class PostRevision(models.Model):
return False
#if sent by email to group and group does not want moderation
- if self.by_email and self.email:
- group_name = self.email.split('@')[0]
+ if self.by_email and self.email_address:
+ group_name = self.email_address.split('@')[0]
try:
group = Tag.objects.get(name = group_name, deleted = False)
return group.group.profile.moderate_email
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js
index 0f349fd8..294c5f41 100644
--- a/askbot/skins/common/media/js/post.js
+++ b/askbot/skins/common/media/js/post.js
@@ -1215,6 +1215,7 @@ EditCommentForm.prototype.attachTo = function(comment, mode){
this._submit_btn.html(gettext('save comment'));
}
this.getElement().show();
+ this.enableButtons();
this.focus();
putCursorAtEnd(this._textarea);
};
@@ -1342,13 +1343,13 @@ EditCommentForm.prototype.createDom = function(){
};
EditCommentForm.prototype.enableButtons = function(){
- this._submit_btn.attr('disabled', '');
- this._cancel_btn.attr('disabled', '');
+ this._submit_btn.attr('disabled', false);
+ this._cancel_btn.attr('disabled', false);
};
EditCommentForm.prototype.disableButtons = function(){
- this._submit_btn.attr('disabled', 'disabled');
- this._cancel_btn.attr('disabled', 'disabled');
+ this._submit_btn.attr('disabled', true);
+ this._cancel_btn.attr('disabled', true);
};
EditCommentForm.prototype.reset = function(){
diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less
index a98bcdbe..5967817d 100644
--- a/askbot/skins/default/media/style/style.less
+++ b/askbot/skins/default/media/style/style.less
@@ -1276,7 +1276,7 @@ ul#related-tags li {
#askFormBar {
display:inline-block;
- padding: 4px 7px 5px 0px;
+ padding: 4px 7px 0px 0px;
margin-top:0px;
p{
@@ -1299,10 +1299,8 @@ ul#related-tags li {
.ask-page, .edit-question-page {
div#question-list {
- float: none;
border-bottom:#f0f0ec 1px solid;
- float:left;
- margin-bottom:10px;
+ float: none;
a{
line-height:30px;
}
@@ -1349,6 +1347,7 @@ ul#related-tags li {
.title-desc {
color: @info-text;
font-size: 13px;
+ margin-bottom: 5px;
}
#fmanswer input.submit,
diff --git a/askbot/utils/decorators.py b/askbot/utils/decorators.py
index 940c3654..0042df8f 100644
--- a/askbot/utils/decorators.py
+++ b/askbot/utils/decorators.py
@@ -87,7 +87,7 @@ def ajax_only(view_func):
if data is None:
data = {}
except Exception, e:
- if isinstance(e, Exception):
+ if hasattr(e, 'messages'):
if len(e.messages) > 1:
message = u'<ul>' + \
u''.join(
diff --git a/askbot/utils/mail.py b/askbot/utils/mail.py
index 37245b5a..aa4df320 100644
--- a/askbot/utils/mail.py
+++ b/askbot/utils/mail.py
@@ -281,7 +281,7 @@ def process_emailed_question(from_address, subject, parts, tags = None):
user.post_question(
title = title,
- tags = tagnames,
+ tags = tagnames.strip(),
body_text = body_text,
by_email = True,
email_address = from_address
diff --git a/askbot/views/commands.py b/askbot/views/commands.py
index 0bb64475..6fd493cc 100644
--- a/askbot/views/commands.py
+++ b/askbot/views/commands.py
@@ -110,7 +110,7 @@ def manage_inbox(request):
mail.send_mail(
subject_line = _('your post was not accepted'),
body_text = unicode(body_text),
- recipient_list = [post.author,]
+ recipient_list = [post.author.email,]
)
memo.delete()
diff --git a/askbot/views/writers.py b/askbot/views/writers.py
index 7727eb04..935b7cfa 100644
--- a/askbot/views/writers.py
+++ b/askbot/views/writers.py
@@ -540,7 +540,7 @@ def __generate_comments_json(obj, user):#non-view generates json data for the po
comment_owner = comment.author
- tz = template_filters.TIMEZONE_STR
+ tz = ' ' + template_filters.TIMEZONE_STR
comment_data = {'id' : comment.id,
'object_id': obj.id,
'comment_added_at': str(comment.added_at.replace(microsecond = 0)) + tz,
@@ -603,11 +603,12 @@ def edit_comment(request):
is_deletable = template_filters.can_delete_comment(comment_post.author, comment_post)
is_editable = template_filters.can_edit_comment(comment_post.author, comment_post)
+ tz = ' ' + template_filters.TIMEZONE_STR
return {
'id' : comment_post.id,
'object_id': comment_post.parent.id,
- 'comment_added_at': str(comment_post.added_at.replace(microsecond = 0)),
+ 'comment_added_at': str(comment_post.added_at.replace(microsecond = 0)) + tz,
'html': comment_post.html,
'user_display_name': comment_post.author.username,
'user_url': comment_post.author.get_profile_url(),