]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/user.py
Adds a couple of options to manage the "accepting answers" workflow.
[osqa.git] / forum / models / user.py
index fb13c27f7c5524c27b2aaa544d207f76ac978a97..cabaabbd156947e6456c3b82f999aa4d5920c18f 100644 (file)
@@ -276,7 +276,7 @@ class User(BaseModel, DjangoUser):
 
     @true_if_is_super_or_staff
     def can_accept_answer(self, answer):
-        return self == answer.question.author
+        return self == answer.question.author and (settings.USERS_CAN_ACCEPT_OWN or answer.author != answer.question.author)
 
     @true_if_is_super_or_staff
     def can_create_tags(self):