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
e9713a31
Verified
Commit
e9713a31
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 319-replace-django-easy-audit
parents
2176ec0d
0ff3ebb4
No related branches found
No related tags found
1 merge request
!385
Resolve "Replace django-easy-audit"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
aleksis/core/mixins.py
+2
-2
2 additions, 2 deletions
aleksis/core/mixins.py
aleksis/core/models.py
+7
-7
7 additions, 7 deletions
aleksis/core/models.py
aleksis/core/settings.py
+3
-0
3 additions, 0 deletions
aleksis/core/settings.py
tox.ini
+4
-5
4 additions, 5 deletions
tox.ini
with
16 additions
and
14 deletions
aleksis/core/mixins.py
+
2
−
2
View file @
e9713a31
...
...
@@ -345,11 +345,11 @@ class SuccessMessageMixin(ModelFormMixin):
return
super
().
form_valid
(
form
)
class
AdvancedCreateView
(
CreateView
,
SuccessMessageMixin
):
class
AdvancedCreateView
(
SuccessMessageMixin
,
CreateView
):
pass
class
AdvancedEditView
(
UpdateView
,
SuccessMessageMixin
):
class
AdvancedEditView
(
SuccessMessageMixin
,
UpdateView
):
pass
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/models.py
+
7
−
7
View file @
e9713a31
...
...
@@ -227,9 +227,9 @@ class Person(ExtensibleModel):
def
age_at
(
self
,
today
):
if
self
.
date_of_birth
:
years
=
today
.
year
-
self
.
date_of_birth
.
year
if
(
self
.
date_of_birth
.
month
>
today
.
month
or
(
self
.
date_of_birth
.
month
==
today
.
month
and
self
.
date_of_birth
.
day
>
today
.
day
)
):
if
self
.
date_of_birth
.
month
>
today
.
month
or
(
self
.
date_of_birth
.
month
==
today
.
month
and
self
.
date_of_birth
.
day
>
today
.
day
):
years
-=
1
return
years
...
...
@@ -389,14 +389,14 @@ class Group(SchoolTermRelatedExtensibleModel):
"""
Get stats about a given group
"""
stats
=
{}
stats
[
'
members
'
]
=
len
(
self
.
members
.
all
())
stats
[
"
members
"
]
=
len
(
self
.
members
.
all
())
ages
=
[
person
.
age
for
person
in
self
.
members
.
filter
(
date_of_birth__isnull
=
False
)]
if
ages
:
stats
[
'
age_avg
'
]
=
sum
(
ages
)
/
len
(
ages
)
stats
[
'
age_range_min
'
]
=
min
(
ages
)
stats
[
'
age_range_max
'
]
=
max
(
ages
)
stats
[
"
age_avg
"
]
=
sum
(
ages
)
/
len
(
ages
)
stats
[
"
age_range_min
"
]
=
min
(
ages
)
stats
[
"
age_range_max
"
]
=
max
(
ages
)
return
stats
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/settings.py
+
3
−
0
View file @
e9713a31
...
...
@@ -414,6 +414,9 @@ DBBACKUP_COMPRESS_MEDIA = _settings.get("backup.media.compress", True)
DBBACKUP_ENCRYPT_MEDIA
=
_settings
.
get
(
"
backup.media.encrypt
"
,
DBBACKUP_GPG_RECIPIENT
is
not
None
)
DBBACKUP_CLEANUP_DB
=
_settings
.
get
(
"
backup.database.clean
"
,
True
)
DBBACKUP_CLEANUP_MEDIA
=
_settings
.
get
(
"
backup.media.clean
"
,
True
)
DBBACKUP_CONNECTOR_MAPPING
=
{
"
django_prometheus.db.backends.postgresql
"
:
"
dbbackup.db.postgresql.PgDumpConnector
"
,
}
IMPERSONATE
=
{
"
USE_HTTP_REFERER
"
:
True
,
"
REQUIRE_SUPERUSER
"
:
True
,
"
ALLOW_SUPERUSER
"
:
True
}
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
4
−
5
View file @
e9713a31
[tox]
skipsdist
=
True
skip_missing_interpreters
=
true
envlist
=
py37,py38
envlist
=
py37,py38
,py39
[testenv]
whitelist_externals
=
poetry
...
...
@@ -22,8 +22,8 @@ setenv =
[testenv:lint]
commands
=
-
poetry
run
black
--check
--diff
aleksis/
-
poetry
run
isort
-c
--diff
--stdout
aleksis/
poetry
run
black
--check
--diff
aleksis/
poetry
run
isort
-c
--diff
--stdout
aleksis/
poetry
run
flake8
{posargs}
aleksis/
[testenv:security]
...
...
@@ -49,9 +49,8 @@ exclude = migrations,tests
ignore
=
BLK100,E203,E231,W503,D100,D101,D102,D103,D104,D105,D106,D107,RST215,RST214,F821,F841,S106,T100,T101,DJ05
[isort]
profile
=
black
line_length
=
100
multi_line_output
=
3
include_trailing_comma
=
1
default_section
=
THIRDPARTY
known_first_party
=
aleksis
known_django
=
django
...
...
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