diff --git a/files/assets/js/award_modal.js b/files/assets/js/award_modal.js index 1c20e76a4..04b5b11c3 100644 --- a/files/assets/js/award_modal.js +++ b/files/assets/js/award_modal.js @@ -79,13 +79,13 @@ function awardModal(link) { target.action = link; } -function pick(kind) { +function pick(kind, canbuy1, canbuy2) { let buy1 = document.getElementById('buy1') - if (kind == "grass") buy1.disabled=true; - else buy1.disabled=false; + if (canbuy1 && kind != "grass") buy1.disabled=false; + else buy1.disabled=true; let buy2 = document.getElementById('buy2') - if (kind == "benefactor") buy2.disabled=true; - else buy2.disabled=false; + if (canbuy2 && kind != "benefactor") buy2.disabled=false; + else buy2.disabled=true; let ownednum = Number(document.getElementById(`${kind}-owned`).textContent); document.getElementById('giveaward').disabled = (ownednum == 0); document.getElementById('kind').value=kind; diff --git a/files/classes/comment.py b/files/classes/comment.py index 22a7fe82b..4207dbd14 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -415,13 +415,11 @@ class Comment(Base): if self.over_18 and not (v and v.over_18) and not (self.post and self.post.over_18): return True - if not v: return False - - if v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True - if self.is_banned: return True - + if path.startswith('/post') and (self.slots_result or self.blackjack_result) and len(self.body) <= 20 and self.level > 1: return True + + if v and v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True return False diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index d9ab8ad8c..73b8563ca 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -1,4 +1,4 @@ - +