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:
@@ -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"):
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user