Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Make go_manage_contact_group extend BaseGoCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
JayH5 committed Jun 19, 2015
1 parent f2ff4b5 commit 3f8706e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions go/base/management/commands/go_manage_contact_group.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from optparse import make_option

from django.core.management.base import BaseCommand, CommandError
from go.base.command_utils import BaseGoCommand, CommandError

from go.base.utils import vumi_api_for_user
from go.base.command_utils import get_user_by_email


class Command(BaseCommand):
class Command(BaseGoCommand):
help = "Manage contact groups belonging to a Vumi Go account."

LOCAL_OPTIONS = [
Expand Down Expand Up @@ -40,7 +37,7 @@ class Command(BaseCommand):
default=False,
help='Delete a group'),
]
option_list = BaseCommand.option_list + tuple(LOCAL_OPTIONS)
option_list = BaseGoCommand.option_list + tuple(LOCAL_OPTIONS)

def ask_for_option(self, options, opt):
if options.get(opt.dest) is None:
Expand Down Expand Up @@ -71,8 +68,7 @@ def handle(self, *args, **options):
options, ('list', 'create', 'create-smart', 'delete'))

self.ask_for_options(options, ['email-address'])
user = get_user_by_email(options['email-address'])
user_api = vumi_api_for_user(user)
user, user_api = self.mk_user_api(options['email-address'])

if operation == 'list':
return self.handle_list(user_api, options)
Expand Down

0 comments on commit 3f8706e

Please sign in to comment.