diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-28 11:55:48 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-28 11:55:48 -0300 |
commit | 46b1be8f609e72baef4fd61d50663cc559eaab9a (patch) | |
tree | cb82b872b3109a7403cd97352ddedd6b01cea1d5 | |
parent | 3a9feb5136f4fc0cacdb7167cf8d07f1176ec983 (diff) | |
download | askbot-46b1be8f609e72baef4fd61d50663cc559eaab9a.tar.gz askbot-46b1be8f609e72baef4fd61d50663cc559eaab9a.tar.bz2 askbot-46b1be8f609e72baef4fd61d50663cc559eaab9a.zip |
made it possible for the admins and moderators to accept best answers
-rw-r--r-- | askbot/models/__init__.py | 7 | ||||
-rw-r--r-- | askbot/skins/common/media/js/post.js | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index 6a609923..16b43dcd 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -345,8 +345,11 @@ def user_assert_can_unaccept_best_answer(self, answer = None): return # success elif self.is_administrator() or self.is_moderator(): - will_be_able_at = (answer.added_at + - datetime.timedelta(days=askbot_settings.MIN_DAYS_FOR_STAFF_TO_ACCEPT_ANSWER)) + will_be_able_at = ( + answer.added_at + + datetime.timedelta( + days=askbot_settings.MIN_DAYS_FOR_STAFF_TO_ACCEPT_ANSWER) + ) if datetime.datetime.now() < will_be_able_at: error_message = _( diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js index 5dc49080..e35608fa 100644 --- a/askbot/skins/common/media/js/post.js +++ b/askbot/skins/common/media/js/post.js @@ -402,12 +402,10 @@ var Vote = function(){ var bindEvents = function(){ // accept answers - if(questionAuthorId == currentUserId){ - var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']'; - $(acceptedButtons).unbind('click').click(function(event){ - Vote.accept($(event.target)); - }); - } + var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']'; + $(acceptedButtons).unbind('click').click(function(event){ + Vote.accept($(event.target)); + }); // set favorite question var favoriteButton = getFavoriteButton(); favoriteButton.unbind('click').click(function(event){ |