From 06ecd44d0292e40a1ab8d6bb320bec3a86b7d7c2 Mon Sep 17 00:00:00 2001 From: Krokmou Date: Thu, 22 Mar 2018 19:21:49 +0100 Subject: [PATCH] chsh affiche le shell actuel --- users/management/commands/chsh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users/management/commands/chsh.py b/users/management/commands/chsh.py index bcfec3a8..df4d6c0d 100755 --- a/users/management/commands/chsh.py +++ b/users/management/commands/chsh.py @@ -54,7 +54,11 @@ class Command(BaseCommand): raise CommandError(msg) shells = ListShell.objects.all() - self.stdout.write("Choisissez un shell pour l'utilisateur %s :" % target_user.pseudo) + + current_shell = "inconnu" + if target_user.shell: + current_shell = target_user.shell.get_pretty_name() + self.stdout.write("Choisissez un shell pour l'utilisateur %s (le shell actuel est %s) :" % (target_user.pseudo, current_shell)) for shell in shells: self.stdout.write("%d - %s (%s)" % (shell.id, shell.get_pretty_name(), shell.shell)) shell_id = input("Entrez un nombre : ")