Commit b270f128 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Handle project-show invalid input

Raise CommandError there is no such project
parent e9148c56
......@@ -61,9 +61,17 @@ class Command(BaseCommand):
if is_id:
name_or_id = int(name_or_id)
infolist = (app_info(name_or_id, is_id) if options['app']
search_application = True if options['app'] else False
infolist = (app_info(name_or_id, is_id) if search_application
else project_info(name_or_id, is_id))
if not infolist:
kind = 'project application' if search_application else 'project'
field = 'id' if is_id or 'name'
msg = "Unknown %s with %s '%s'" % (kind, field, name_or_id)
raise CommandError(msg)
for info in infolist:
self.show_info(info)
......
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