mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
T2 ruff rule
This commit is contained in:
@ -40,7 +40,7 @@ class Command(BaseCommand):
|
||||
user = User.objects.filter(id=options["user_id"]).first()
|
||||
|
||||
if user is None:
|
||||
print("User with ID %s not found" % (options["user_id"],))
|
||||
self.stderr.write("User with ID %s not found" % (options["user_id"],))
|
||||
exit(1)
|
||||
|
||||
confirm = input(
|
||||
@ -49,7 +49,7 @@ class Command(BaseCommand):
|
||||
)
|
||||
|
||||
if not confirm.lower().startswith("y"):
|
||||
print("Operation aborted")
|
||||
self.stderr.write("Operation aborted")
|
||||
exit(1)
|
||||
|
||||
delete_all_forum_user_messages(user, User.objects.get(id=0), verbose=True)
|
||||
|
@ -21,6 +21,7 @@
|
||||
# Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#
|
||||
import logging
|
||||
|
||||
from ajax_select.fields import AutoCompleteSelectField
|
||||
from django import forms
|
||||
@ -146,7 +147,7 @@ def delete_all_forum_user_messages(user, moderator, *, verbose=False):
|
||||
continue
|
||||
|
||||
if verbose:
|
||||
print(message)
|
||||
logging.getLogger("django").info(message)
|
||||
ForumMessageMeta(message=message, user=moderator, action="DELETE").save()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user