diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 4c049a74..f880d485 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-03-18 20:48+0100\n" +"POT-Creation-Date: 2019-03-19 17:16+0100\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Skia \n" "Language-Team: AE info \n" @@ -4618,9 +4618,11 @@ msgstr "Supprimer les messages" #: rootplace/templates/rootplace/delete_user_messages.jinja:14 msgid "" "If you have trouble using this utility (timeout error, 500 error), try using " -"the command line utility" -msgstr "Si vous avez des soucis en utilisant cet utilitaire (connection expirée, erreur 500), " -"essayez en utilisant l'utilitaire en ligne de commande" +"the command line utility. Use ./manage.py delete_all_forum_user_messages ID." +msgstr "" +"Si vous avez des soucis en utilisant cet utilitaire (connexion expirée, " +"erreur 500), essayez en utilisant l'utilitaire en ligne de commande. " +"Utilisez ./manage.py delete_user_messages ID." #: rootplace/templates/rootplace/merge.jinja:8 msgid "Merge two users" diff --git a/rootplace/management/commands/delete_all_forum_user_messages.py b/rootplace/management/commands/delete_all_forum_user_messages.py index 6aabd5f2..3d6b4a22 100644 --- a/rootplace/management/commands/delete_all_forum_user_messages.py +++ b/rootplace/management/commands/delete_all_forum_user_messages.py @@ -31,8 +31,7 @@ from rootplace.views import delete_all_forum_user_messages class Command(BaseCommand): """ - Delete all forum messages from an user - Messages are soft deleted and are still visible from admins + Delete all forum messages from a user """ help = "Delete all user's forum message" @@ -46,15 +45,15 @@ class Command(BaseCommand): if user is None: print("User with ID %s not found" % (options["user_id"],)) - return + exit(1) confirm = input( - "User selected %s\nDo you really want to delete all user's messages ? [y/N] " + "User selected: %s\nDo you really want to delete all message from this user ? [y/N] " % (user,) ) - if confirm != "y" and confirm != "Y": + if not confirm.lower().startswith("y"): print("Operation aborted") - return + exit(1) delete_all_forum_user_messages(user, User.objects.get(id=0), True) diff --git a/rootplace/templates/rootplace/delete_user_messages.jinja b/rootplace/templates/rootplace/delete_user_messages.jinja index 7ee411d9..01866d6e 100644 --- a/rootplace/templates/rootplace/delete_user_messages.jinja +++ b/rootplace/templates/rootplace/delete_user_messages.jinja @@ -11,5 +11,5 @@ {{ form.as_p() }}

-

{% trans %}If you have trouble using this utility (timeout error, 500 error), try using the command line utility{% endtrans %}

+

{% trans %}If you have trouble using this utility (timeout error, 500 error), try using the command line utility. Use ./manage.py delete_all_forum_user_messages ID.{% endtrans %}

{% endblock %} \ No newline at end of file