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
cb077883
Verified
Commit
cb077883
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Enforce a linked person to use the dashboard
Closes
#149
parent
6afcf954
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!110
Resolve "RelatedObjectDoesNotExist at / User has no person."
Pipeline
#576
failed
5 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/views.py
+8
-14
8 additions, 14 deletions
aleksis/core/views.py
with
8 additions
and
14 deletions
aleksis/core/views.py
+
8
−
14
View file @
cb077883
...
...
@@ -8,7 +8,7 @@ from django.utils.translation import ugettext_lazy as _
from
django_tables2
import
RequestConfig
from
.decorators
import
admin_required
from
.decorators
import
admin_required
,
person_required
from
.forms
import
(
EditGroupForm
,
EditPersonForm
,
...
...
@@ -21,23 +21,17 @@ from .tables import GroupsTable, PersonsTable
from
.util
import
messages
@
logi
n_required
@
perso
n_required
def
index
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
if
request
.
user
.
is_authenticated
:
activities
=
request
.
user
.
person
.
activities
.
all
()[:
5
]
notifications
=
(
request
.
user
.
person
.
notifications
.
all
()[:
5
]
)
unread_notifications
=
(
request
.
user
.
person
.
notifications
.
all
().
filter
(
read
=
False
)
)
activities
=
request
.
user
.
person
.
activities
.
all
()[:
5
]
notifications
=
request
.
user
.
person
.
notifications
.
all
()[:
5
]
unread_notifications
=
request
.
user
.
person
.
notifications
.
all
().
filter
(
read
=
False
)
context
[
"
activities
"
]
=
activities
context
[
"
notifications
"
]
=
notifications
context
[
"
unread_notifications
"
]
=
unread_notifications
context
[
"
activities
"
]
=
activities
context
[
"
notifications
"
]
=
notifications
context
[
"
unread_notifications
"
]
=
unread_notifications
return
render
(
request
,
"
core/index.html
"
,
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