diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-10 16:55:27 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-10 16:55:27 -0400 |
commit | c92c21d4cf239e46262ac1956e03dc74889aeb26 (patch) | |
tree | 810912d48afa3a143a503600d97a2556c3bee5a5 | |
parent | 8b40f808048dd7832ddbdf509219abdfa19d2502 (diff) | |
parent | 81d64e494eeaf184d3dc7e6105b2815486e93053 (diff) | |
download | askbot-c92c21d4cf239e46262ac1956e03dc74889aeb26.tar.gz askbot-c92c21d4cf239e46262ac1956e03dc74889aeb26.tar.bz2 askbot-c92c21d4cf239e46262ac1956e03dc74889aeb26.zip |
Merge branch 'user-groups' into master-test
-rw-r--r-- | askbot/lamson_handlers.py | 2 | ||||
-rw-r--r-- | askbot/models/__init__.py | 1 | ||||
-rw-r--r-- | askbot/models/post.py | 4 | ||||
-rw-r--r-- | askbot/skins/common/media/js/post.js | 9 | ||||
-rw-r--r-- | askbot/skins/default/media/style/style.less | 7 | ||||
-rw-r--r-- | askbot/utils/decorators.py | 2 | ||||
-rw-r--r-- | askbot/utils/mail.py | 2 | ||||
-rw-r--r-- | askbot/views/commands.py | 4 | ||||
-rw-r--r-- | askbot/views/writers.py | 3 |
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 09d008d2..69cdede0 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -1299,7 +1299,7 @@ ul#related-tags li { #askFormBar { display:inline-block; - padding: 4px 7px 5px 0px; + padding: 4px 7px 0px 0px; margin-top:0px; p{ @@ -1322,10 +1322,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; } @@ -1372,6 +1370,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 2cad834e..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() @@ -589,7 +589,7 @@ def set_tag_filter_strategy(request): """ filter_type = request.POST['filter_type'] filter_value = int(request.POST['filter_value']) - assert(filter_type in 'display', 'email') + assert(filter_type in ('display', 'email')) if filter_type == 'display': assert(filter_value in dict(const.TAG_DISPLAY_FILTER_STRATEGY_CHOICES)) request.user.display_tag_filter_strategy = filter_value diff --git a/askbot/views/writers.py b/askbot/views/writers.py index 995b878e..44b80ed9 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,6 +603,7 @@ 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 tz = template_filters.TIMEZONE_STR |