Annotate commands/export_single_user.py.

This commit is contained in:
Steve Howell 2016-09-11 15:54:02 -07:00 committed by Tim Abbott
parent bb6fcaa4e7
commit 52c6efa0a8

View File

@ -1,6 +1,9 @@
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
@ -23,6 +26,7 @@ class Command(BaseCommand):
with (for example) any bots owned by the user."""
def add_arguments(self, parser):
# type: (ArgumentParser) -> None
parser.add_argument('email', metavar='<email>', type=str,
help="email of user to export")
parser.add_argument('--output',
@ -32,6 +36,7 @@ class Command(BaseCommand):
help='Directory to write exported data to.')
def handle(self, *args, **options):
# type: (*Any, **Any) -> None
try:
user_profile = get_user_profile_by_email(options["email"])
except UserProfile.DoesNotExist: