Revision 54f827f7 snf-astakos-app/astakos/im/management/commands/user-modify.py
b/snf-astakos-app/astakos/im/management/commands/user-modify.py | ||
---|---|---|
345 | 345 |
raise CommandError(m) |
346 | 346 |
management.call_command('user-show', str(user.pk), |
347 | 347 |
list_quotas=True) |
348 |
m = "Are you sure you want to permanently delete the user " \ |
|
349 |
"(yes/no) ? " |
|
350 | 348 |
|
351 |
self.stdout.write("\n")
|
|
352 |
confirm = raw_input(m)
|
|
353 |
if confirm == "yes":
|
|
354 |
user.delete()
|
|
349 |
if not force:
|
|
350 |
self.stdout.write("About to delete user %s. " % user.uuid)
|
|
351 |
self.confirm()
|
|
352 |
user.delete() |
|
355 | 353 |
|
356 | 354 |
# Change users email address |
357 | 355 |
newemail = options.get('set-email', None) |
... | ... | |
372 | 370 |
|
373 | 371 |
def confirm(self): |
374 | 372 |
self.stdout.write("Confirm? [y/N] ") |
375 |
response = raw_input() |
|
373 |
try: |
|
374 |
response = raw_input() |
|
375 |
except EOFError: |
|
376 |
response = "ABORT" |
|
376 | 377 |
if string.lower(response) not in ['y', 'yes']: |
377 | 378 |
self.stderr.write("Aborted.\n") |
378 | 379 |
exit() |
Also available in: Unified diff