Commit 9ed26109 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Improve output of quota commands

parent f90043b2
......@@ -128,19 +128,19 @@ class Command(SynnefoCommand):
try:
user = AstakosUser.objects.get(uuid=user_ident)
except AstakosUser.DoesNotExist:
raise CommandError('Not found user having uuid: %s' %
raise CommandError('There is no user with uuid: %s' %
user_ident)
elif is_email(user_ident):
try:
user = AstakosUser.objects.get(username=user_ident)
except AstakosUser.DoesNotExist:
raise CommandError('Not found user having email: %s' %
raise CommandError('There is no user with email: %s' %
user_ident)
else:
raise CommandError('Please specify user by uuid or email')
if not user.email_verified and sync:
raise CommandError('User %s is not verified.' % user.uuid)
if not user.email_verified:
raise CommandError('%s is not a verified user.\n' % user.uuid)
return user
......
......@@ -122,11 +122,13 @@ class Command(SynnefoCommand):
options["output_format"], vertical=True)
if options["list_quotas"]:
self.stdout.write("\n")
quotas, initial = list_user_quotas([user])
print_data, labels = show_quotas(quotas, initial)
utils.pprint_table(self.stdout, print_data, labels,
options["output_format"])
if quotas:
self.stdout.write("\n")
print_data, labels = show_quotas(quotas, initial)
utils.pprint_table(self.stdout, print_data, labels,
options["output_format"],
title="User Quota")
if options["list_projects"]:
print_data, labels = ownerships(user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment