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
c6da204a
Verified
Commit
c6da204a
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Move crawling code for licence information from settings.py to corresponding view
parent
668885f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!146
Resolve "Add licence information page"
Pipeline
#804
passed with warnings
5 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/settings.py
+0
-13
0 additions, 13 deletions
aleksis/core/settings.py
aleksis/core/views.py
+16
-2
16 additions, 2 deletions
aleksis/core/views.py
with
16 additions
and
15 deletions
aleksis/core/settings.py
+
0
−
13
View file @
c6da204a
...
...
@@ -480,16 +480,3 @@ CKEDITOR_CONFIGS = {
]),
}
}
LICENCE_INFORMATION
=
[]
packages
=
list
(
get_app_packages
())
packages
.
insert
(
0
,
"
aleksis.core
"
)
for
app
in
packages
:
app_mod
=
import_module
(
app
)
try
:
licence_information
=
app_mod
.
LICENCE_INFORMATION
LICENCE_INFORMATION
.
append
(
licence_information
)
except
AttributeError
:
pass
This diff is collapsed.
Click to expand it.
aleksis/core/views.py
+
16
−
2
View file @
c6da204a
from
importlib
import
import_module
from
typing
import
Optional
from
django.contrib.auth.decorators
import
login_required
...
...
@@ -5,7 +6,6 @@ from django.core.exceptions import PermissionDenied
from
django.http
import
Http404
,
HttpRequest
,
HttpResponse
from
django.shortcuts
import
get_object_or_404
,
redirect
,
render
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.conf
import
settings
from
django_tables2
import
RequestConfig
...
...
@@ -20,6 +20,7 @@ from .forms import (
from
.models
import
Activity
,
Group
,
Notification
,
Person
,
School
,
DashboardWidget
from
.tables
import
GroupsTable
,
PersonsTable
from
.util
import
messages
from
.util.core_helpers
import
get_app_packages
@person_required
...
...
@@ -46,10 +47,23 @@ def offline(request):
def
about
(
request
):
context
=
{}
context
[
"
licence_information
"
]
=
settings
.
LICENCE_INFORMATION
licence_information
=
[]
packages
=
list
(
get_app_packages
())
packages
.
insert
(
0
,
"
aleksis.core
"
)
for
app
in
packages
:
app_mod
=
import_module
(
app
)
try
:
licence_information
.
append
(
app_mod
.
LICENCE_INFORMATION
)
except
AttributeError
:
pass
context
[
"
licence_information
"
]
=
licence_information
return
render
(
request
,
"
core/about.html
"
,
context
)
@login_required
def
persons
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
...
...
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