|
|
@ -21,9 +21,8 @@ from base64 import decodebytes |
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
|
from django.core.management.base import BaseCommand, CommandError |
|
|
from django.core.management.base import BaseCommand, CommandError |
|
|
|
|
|
|
|
|
from ldap_sync.models import (synchronise_serviceuser, synchronise_user, |
|
|
from users.models import User, ListRight, ServiceUser |
|
|
synchronise_usergroup) |
|
|
from ldap_sync.models import synchronise_user, synchronise_serviceuser, synchronise_usergroup |
|
|
from users.models import ListRight, User |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def split_lines(lines): |
|
|
def split_lines(lines): |
|
|
@ -95,6 +94,8 @@ def sync_ldap(): |
|
|
synchronise_user(sender=User, instance=u) |
|
|
synchronise_user(sender=User, instance=u) |
|
|
for lr in ListRight.objects.all(): |
|
|
for lr in ListRight.objects.all(): |
|
|
synchronise_usergroup(sender=ListRight, instance=lr) |
|
|
synchronise_usergroup(sender=ListRight, instance=lr) |
|
|
|
|
|
for service_user in ServiceUser.objects.all(): |
|
|
|
|
|
synchronise_serviceuser(sender=ServiceUser, instance=service_user) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand): |
|
|
class Command(BaseCommand): |
|
|
|