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
04ab1ed1
Verified
Commit
04ab1ed1
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Return copyright years as string
parent
d2e90e15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!146
Resolve "Add licence information page"
Pipeline
#1532
failed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/util/apps.py
+18
-2
18 additions, 2 deletions
aleksis/core/util/apps.py
with
18 additions
and
2 deletions
aleksis/core/util/apps.py
+
18
−
2
View file @
04ab1ed1
...
...
@@ -10,6 +10,8 @@ from constance.signals import config_updated
from
license_expression
import
Licensing
,
LicenseSymbol
from
spdx_license_list
import
LICENSES
from
.core_helpers
import
copyright_years
class
AppConfig
(
django
.
apps
.
AppConfig
):
"""
An extended version of DJango
'
s AppConfig container.
"""
...
...
@@ -106,8 +108,22 @@ class AppConfig(django.apps.AppConfig):
# TODO Try getting from distribution if not set
@classmethod
def
get_copyright
(
cls
):
return
getattr
(
cls
,
"
copyright
"
,
tuple
())
def
get_copyright
(
cls
)
->
Sequence
[
Tuple
[
str
,
str
,
str
]]:
copyrights
=
getattr
(
cls
,
"
copyright
"
,
tuple
())
copyrights_processed
=
[]
for
copyright
in
copyrights
:
copyrights_processed
.
append
(
(
copyright
[
0
]
if
isinstance
(
copyright
[
0
],
str
)
else
copyright_years
(
copyright
[
0
]),
copyright
[
1
],
copyright
[
2
],
)
)
return
copyrights_processed
# TODO Try getting from distribution if not set
def
config_updated
(
...
...
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