Files
@ ba1df47d695b
Branch filter:
Location: symposion_app/symposion/reviews/management/commands/create_review_permissions.py - annotation
ba1df47d695b
861 B
text/x-python
Remove templates
These have all been moved to the starter project,
pinax-project-symposion. The reasoning behind this is they are very
specific to the theme (pinax-theme-bootstrap) that the project uses and
not really all that reusable when packaged with this app.
These have all been moved to the starter project,
pinax-project-symposion. The reasoning behind this is they are very
specific to the theme (pinax-theme-bootstrap) that the project uses and
not really all that reusable when packaged with this app.
3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 36ab6d599ffc 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 36ab6d599ffc 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 3d68af979659 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from symposion.proposals.models import ProposalSection
class Command(BaseCommand):
def handle(self, *args, **options):
ct, created = ContentType.objects.get_or_create(
model="",
app_label="reviews",
defaults={"name": "reviews"}
)
for ps in ProposalSection.objects.all():
for action in ["review", "manage"]:
perm, created = Permission.objects.get_or_create(
codename="can_%s_%s" % (action, ps.section.slug),
content_type__pk=ct.id,
defaults={"name": "Can %s %s" % (action, ps), "content_type": ct}
)
print perm
|