Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
1ae4215c
Verified
Commit
1ae4215c
authored
4 years ago
by
Nik | Klampfradler
Committed by
Jonathan Weth
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CHange config_updated signal handle to preference_updated
parent
aefbade8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!217
Migrate from constance to dynamic-preferences
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/apps.py
+11
-2
11 additions, 2 deletions
aleksis/core/apps.py
aleksis/core/util/apps.py
+7
-5
7 additions, 5 deletions
aleksis/core/util/apps.py
with
18 additions
and
7 deletions
aleksis/core/apps.py
+
11
−
2
View file @
1ae4215c
...
...
@@ -27,8 +27,17 @@ class CoreConfig(AppConfig):
([
2019
,
2020
],
"
Tom Teichler
"
,
"
tom.teichler@teckids.org
"
),
)
def
config_updated
(
self
,
*
args
,
**
kwargs
)
->
None
:
clean_scss
()
def
preference_updated
(
self
,
sender
:
Any
,
section
:
Optional
[
str
]
=
None
,,
name
:
Optional
[
str
]
=
None
,
old_value
:
Optional
[
Any
]
=
None
,
new_value
:
Optional
[
Any
]
=
None
,
**
kwargs
,
)
->
None
:
if
section
==
"
theme
"
:
clean_scss
()
def
post_migrate
(
self
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/util/apps.py
+
7
−
5
View file @
1ae4215c
...
...
@@ -6,7 +6,7 @@ from django.contrib.auth.signals import user_logged_in, user_logged_out
from
django.db.models.signals
import
post_migrate
,
pre_migrate
from
django.http
import
HttpRequest
from
consta
nce.signals
import
config
_updated
from
dynamic_prefere
nce
s
.signals
import
preference
_updated
from
license_expression
import
Licensing
,
LicenseSymbol
from
spdx_license_list
import
LICENSES
...
...
@@ -31,7 +31,7 @@ class AppConfig(django.apps.AppConfig):
# Register default listeners
pre_migrate
.
connect
(
self
.
pre_migrate
,
sender
=
self
)
post_migrate
.
connect
(
self
.
post_migrate
,
sender
=
self
)
config
_updated
.
connect
(
self
.
config
_updated
)
preference
_updated
.
connect
(
self
.
preference
_updated
)
user_logged_in
.
connect
(
self
.
user_logged_in
)
user_logged_out
.
connect
(
self
.
user_logged_out
)
...
...
@@ -126,14 +126,16 @@ class AppConfig(django.apps.AppConfig):
# TODO Try getting from distribution if not set
def
config
_updated
(
def
preference
_updated
(
self
,
key
:
Optional
[
str
]
=
""
,
sender
:
Any
,
section
:
Optional
[
str
]
=
None
,,
name
:
Optional
[
str
]
=
None
,
old_value
:
Optional
[
Any
]
=
None
,
new_value
:
Optional
[
Any
]
=
None
,
**
kwargs
,
)
->
None
:
"""
Called on every app instance if a
Constance config
cha
g
nes, and once on startup
"""
Called on every app instance if a
dynamic preference
chan
g
es, and once on startup
By default, it does nothing.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment