Update discussion setup instructions to clarify that you need to specify a

course id for seed_permissions_roles, and also the script itself to tell you that.
This commit is contained in:
Ibrahim Awwal
2012-09-11 19:15:18 -07:00
parent 1be378e697
commit 3bc9c7496c
2 changed files with 7 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ If you haven't done so already:
brew install mongodb
Make sure that you have mongodb running. You can simply open a new terminal tab and type:
mongod
## Installing elasticsearch
@@ -72,9 +72,9 @@ For convenience, add the following environment variables to the terminal (assumi
export DJANGO_SETTINGS_MODULE=lms.envs.dev
export PYTHONPATH=.
Now initialzie roles and permissions:
Now initialzie roles and permissions, providing a course id eg.:
django-admin.py seed_permissions_roles
django-admin.py seed_permissions_roles "MITx/6.002x/2012_Fall"
To assign yourself as a moderator, use the following command (assuming your username is "test", and the course id is "MITx/6.002x/2012_Fall"):

View File

@@ -7,8 +7,10 @@ class Command(BaseCommand):
help = 'Seed default permisssions and roles'
def handle(self, *args, **options):
if len(args) != 1:
raise CommandError("The number of arguments does not match. ")
if len(args) == 0:
raise CommandError("Please provide a course id")
if len(args) > 1:
raise CommandError("Too many arguments")
course_id = args[0]
administrator_role = Role.objects.get_or_create(name="Administrator", course_id=course_id)[0]
moderator_role = Role.objects.get_or_create(name="Moderator", course_id=course_id)[0]