Enhance check_user_can_edit method with detailed docstring for clarity
This commit is contained in:
+9
-1
@@ -549,7 +549,15 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
|||||||
|
|
||||||
return size
|
return size
|
||||||
|
|
||||||
def check_user_can_edit(self, user):
|
def check_user_can_edit(self, user) -> bool:
|
||||||
|
"""Check if the user can edit the case.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
user (User): The user to check.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: True if the user can edit the case, False otherwise.
|
||||||
|
"""
|
||||||
if user.is_superuser:
|
if user.is_superuser:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user