2013-06-24 21:24:41 +02:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2016-06-04 16:52:18 +02:00
|
|
|
from typing import Any
|
|
|
|
|
2013-06-24 21:24:41 +02:00
|
|
|
from django.core.management.base import BaseCommand
|
2016-11-22 11:27:47 +01:00
|
|
|
from django.apps import apps
|
2013-06-24 21:24:41 +02:00
|
|
|
from django.contrib.auth.management import create_permissions
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "Sync newly created object permissions to the database"
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2016-06-04 16:52:18 +02:00
|
|
|
# type: (*Any, **Any) -> None
|
2013-06-24 21:24:41 +02:00
|
|
|
# From http://stackoverflow.com/a/11914435/90777
|
2016-11-22 11:27:47 +01:00
|
|
|
create_permissions(apps.get_app_config("zerver"), apps.get_models(), 2)
|