Revision e1a80257 snf-astakos-app/astakos/im/management/commands/invitation-list.py
b/snf-astakos-app/astakos/im/management/commands/invitation-list.py | ||
---|---|---|
33 | 33 |
|
34 | 34 |
from optparse import make_option |
35 | 35 |
|
36 |
from django.core.management.base import BaseCommand, CommandError
|
|
36 |
from django.core.management.base import NoArgsCommand, CommandError
|
|
37 | 37 |
|
38 | 38 |
from astakos.im.models import Invitation |
39 | 39 |
|
40 | 40 |
from ._common import format_bool |
41 | 41 |
|
42 | 42 |
|
43 |
class Command(BaseCommand):
|
|
43 |
class Command(NoArgsCommand):
|
|
44 | 44 |
help = "List invitations" |
45 | 45 |
|
46 |
option_list = BaseCommand.option_list + (
|
|
46 |
option_list = NoArgsCommand.option_list + (
|
|
47 | 47 |
make_option('-c', |
48 | 48 |
action='store_true', |
49 | 49 |
dest='csv', |
... | ... | |
51 | 51 |
help="Use pipes to separate values"), |
52 | 52 |
) |
53 | 53 |
|
54 |
def handle(self, *args, **options): |
|
55 |
if args: |
|
56 |
raise CommandError("Command doesn't accept any arguments") |
|
57 |
|
|
54 |
def handle_noargs(self, **options): |
|
58 | 55 |
invitations = Invitation.objects.all().order_by('id') |
59 | 56 |
|
60 | 57 |
labels = ('id', 'inviter', 'email', 'real name', 'code', 'consumed') |
Also available in: Unified diff