mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-12 09:17:56 +03:00
Fixed meta pool prefetch & configuration save
This commit is contained in:
parent
786e419b27
commit
f306449b0e
@ -97,9 +97,9 @@ class Config:
|
||||
self._data = readed.value
|
||||
self._crypt = [self._crypt, True][readed.crypt] # True has "higher" precedende than False
|
||||
self._longText = readed.long
|
||||
if self._type != -1: # readed.field_type == -1 and
|
||||
if self._type != -1 and self._type != readed.field_type:
|
||||
readed.field_type = self._type
|
||||
readed.save()
|
||||
readed.save(update_fields=['field_type'])
|
||||
self._type = readed.field_type
|
||||
except Exception:
|
||||
# Not found
|
||||
@ -353,9 +353,9 @@ class GlobalConfig:
|
||||
@staticmethod
|
||||
def initialize() -> None:
|
||||
if GlobalConfig._initDone is False:
|
||||
GlobalConfig._initDone = True
|
||||
try:
|
||||
# Tries to initialize database data for global config so it is stored asap and get cached for use
|
||||
GlobalConfig._initDone = True
|
||||
for v in GlobalConfig.__dict__.values():
|
||||
if isinstance(v, Config.Value):
|
||||
v.get()
|
||||
|
@ -158,14 +158,16 @@ class MetaPool(UUIDModel, TaggingMixin): # type: ignore
|
||||
'servicesPoolGroup__image',
|
||||
'assignedGroups',
|
||||
'assignedGroups',
|
||||
'accessCalendars',
|
||||
'accessCalendars__rules',
|
||||
'pools',
|
||||
'pools__service',
|
||||
'pools__service__provider',
|
||||
'pools__image',
|
||||
'pools__transports',
|
||||
'pools__transports__networks'
|
||||
'pools__transports__networks',
|
||||
'calendarAccess',
|
||||
'calendarAccess__calendar',
|
||||
'calendarAccess__calendar__rules',
|
||||
'image'
|
||||
)
|
||||
if user:
|
||||
meta = meta.annotate(
|
||||
|
Loading…
Reference in New Issue
Block a user