rootplace: make code clearer and fix typos

This commit is contained in:
Antoine Bartuccio 2019-03-19 17:23:02 +01:00
parent f9d4f41b7c
commit 46db8b391a
Signed by: klmp200
GPG Key ID: E7245548C53F904B
3 changed files with 12 additions and 11 deletions

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "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" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -4618,9 +4618,11 @@ msgstr "Supprimer les messages"
#: rootplace/templates/rootplace/delete_user_messages.jinja:14 #: rootplace/templates/rootplace/delete_user_messages.jinja:14
msgid "" msgid ""
"If you have trouble using this utility (timeout error, 500 error), try using " "If you have trouble using this utility (timeout error, 500 error), try using "
"the command line utility" "the command line utility. Use ./manage.py delete_all_forum_user_messages ID."
msgstr "Si vous avez des soucis en utilisant cet utilitaire (connection expirée, erreur 500), " msgstr ""
"essayez en utilisant l'utilitaire en ligne de commande" "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 #: rootplace/templates/rootplace/merge.jinja:8
msgid "Merge two users" msgid "Merge two users"

View File

@ -31,8 +31,7 @@ from rootplace.views import delete_all_forum_user_messages
class Command(BaseCommand): class Command(BaseCommand):
""" """
Delete all forum messages from an user Delete all forum messages from a user
Messages are soft deleted and are still visible from admins
""" """
help = "Delete all user's forum message" help = "Delete all user's forum message"
@ -46,15 +45,15 @@ class Command(BaseCommand):
if user is None: if user is None:
print("User with ID %s not found" % (options["user_id"],)) print("User with ID %s not found" % (options["user_id"],))
return exit(1)
confirm = input( 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,) % (user,)
) )
if confirm != "y" and confirm != "Y": if not confirm.lower().startswith("y"):
print("Operation aborted") print("Operation aborted")
return exit(1)
delete_all_forum_user_messages(user, User.objects.get(id=0), True) delete_all_forum_user_messages(user, User.objects.get(id=0), True)

View File

@ -11,5 +11,5 @@
{{ form.as_p() }} {{ form.as_p() }}
<p><input type="submit" value="{% trans %}Delete messages{% endtrans %}" /></p> <p><input type="submit" value="{% trans %}Delete messages{% endtrans %}" /></p>
</form> </form>
<p><strong>{% trans %}If you have trouble using this utility (timeout error, 500 error), try using the command line utility{% endtrans %}</strong></p> <p><strong>{% 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 %}</strong></p>
{% endblock %} {% endblock %}