~andrewsomething/dat-overview/lp1189808

« back to all changes in this revision

Viewing changes to overview/uploads/management/commands/create_user_groups.py

  • Committer: Daniel Holbach
  • Date: 2013-04-10 10:22:03 UTC
  • mfrom: (12.1.5 openid)
  • Revision ID: daniel.holbach@canonical.com-20130410102203-kdm46g9yob6nn78w
mergedĀ lp:~andrewsomething/dat-overview/openid_support

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.core.management.base import NoArgsCommand
 
2
from django.contrib.auth.models import Group
 
3
from django.conf import settings
 
4
 
 
5
 
 
6
class Command(NoArgsCommand):
 
7
    help = "Set up initial Djano User Groups that match LP teams."
 
8
 
 
9
    def handle_noargs(self, **options):
 
10
        for team in settings.ALLOWED_LAUNCHPAD_TEAMS:
 
11
            group, created = Group.objects.get_or_create(name=team)