import Group from user.models
This commit is contained in:
parent
6296be870b
commit
cc56858377
11 changed files with 15 additions and 14 deletions
|
|
@ -15,11 +15,6 @@ from oxdjango.fields import JSONField
|
|||
import ox
|
||||
from ox.utils import json
|
||||
|
||||
from itemlist.models import List, Position
|
||||
import text
|
||||
import edit
|
||||
import documentcollection.models
|
||||
|
||||
from . import managers
|
||||
from . import tasks
|
||||
from .utils import get_ip, get_location
|
||||
|
|
@ -233,6 +228,11 @@ def profile_post_save(sender, instance, **kwargs):
|
|||
models.signals.post_save.connect(profile_post_save, sender=UserProfile)
|
||||
|
||||
def get_ui(user_ui, user=None):
|
||||
from itemlist.models import List, Position
|
||||
import documentcollection.models
|
||||
import edit.models
|
||||
import text.models
|
||||
|
||||
ui = {}
|
||||
config = copy.deepcopy(settings.CONFIG)
|
||||
ui.update(config['user']['ui'])
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from django.contrib.gis.geoip2 import GeoIP2
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
import ox
|
||||
|
||||
|
|
@ -73,6 +72,7 @@ def rename_user(u, new):
|
|||
u.save()
|
||||
|
||||
def update_groups(model, groups):
|
||||
from .models import Group
|
||||
if isinstance(groups, list):
|
||||
groups = list(filter(lambda g: g.strip(), groups))
|
||||
groups = [ox.escape_html(g) for g in groups]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ from django.core.mail import send_mail, BadHeaderError, EmailMessage
|
|||
from django.shortcuts import redirect
|
||||
from django.db import transaction
|
||||
from django.db.models import Max
|
||||
from django.contrib.auth.models import Group
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.sessions.models import Session
|
||||
|
||||
|
|
@ -26,6 +25,7 @@ from oxdjango.api import actions
|
|||
from item.models import Access, Item
|
||||
from item import utils
|
||||
from changelog.models import add_changelog
|
||||
from user.models import Group
|
||||
|
||||
from . import models
|
||||
from .decorators import capability_required_json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue