mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 08:19:15 +02:00
Server CLI: user management
This commit is contained in:
parent
900fabae79
commit
654d206033
13 changed files with 700 additions and 1 deletions
19
api/funkwhale_api/cli/main.py
Normal file
19
api/funkwhale_api/cli/main.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import click
|
||||
import sys
|
||||
|
||||
from . import base
|
||||
from . import users # noqa
|
||||
|
||||
from rest_framework.exceptions import ValidationError
|
||||
|
||||
|
||||
def invoke():
|
||||
try:
|
||||
return base.cli()
|
||||
except ValidationError as e:
|
||||
click.secho("Invalid data:", fg="red")
|
||||
for field, errors in e.detail.items():
|
||||
click.secho(" {}:".format(field), fg="red")
|
||||
for error in errors:
|
||||
click.secho(" - {}".format(error), fg="red")
|
||||
sys.exit(1)
|
Loading…
Add table
Add a link
Reference in a new issue