Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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-App-Alsijil
Commits
3517b2c0
Verified
Commit
3517b2c0
authored
2 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix filter for persons in register object view
parent
2ac67421
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!307
Resolve "Substitution teacher can't see any persons in the lesson view"
Pipeline
#90390
passed
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+5
-0
5 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/alsijil/views.py
+10
-15
10 additions, 15 deletions
aleksis/apps/alsijil/views.py
with
15 additions
and
15 deletions
CHANGELOG.rst
+
5
−
0
View file @
3517b2c0
...
...
@@ -13,7 +13,12 @@ Changed
~~~~~~~
* Use new icon set inside of models and templates
Fixed
~~~~~
* Extra marks and excused absences were counted multiple times in some class register views.
* Substitution teachers couldn't see any persons in the person list of a substituted lesson.
`2.1.1`_ - 2022-09-01
---------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
10
−
15
View file @
3517b2c0
...
...
@@ -236,15 +236,14 @@ def register_object(
if
not
request
.
user
.
has_perm
(
"
alsijil.view_register_object_personalnote_rule
"
,
register_object
):
persons
=
Person
.
objects
.
filter
(
pk
=
request
.
user
.
person
.
pk
)
persons
=
Person
.
objects
.
filter
(
Q
(
pk
=
request
.
user
.
person
.
pk
)
|
Q
(
person__member_of__in
=
request
.
user
.
person
.
owner_of
.
all
())
).
distinct
()
else
:
persons
=
Person
.
objects
.
all
()
persons_qs
=
(
register_object
.
get_personal_notes
(
persons
,
wanted_week
)
.
filter
(
person__member_of__in
=
request
.
user
.
person
.
owner_of
.
all
())
.
distinct
()
)
persons_qs
=
register_object
.
get_personal_notes
(
persons
,
wanted_week
).
distinct
()
# Annotate group roles
if
show_group_roles
:
...
...
@@ -798,16 +797,12 @@ def my_students(request: HttpRequest) -> HttpResponse:
new_groups
=
[]
for
group
in
relevant_groups
:
persons
=
(
group
.
generate_person_list_with_class_register_statistics
(
group
.
members
.
prefetch_related
(
"
primary_group__owners
"
,
Prefetch
(
"
member_of
"
,
queryset
=
relevant_groups
,
to_attr
=
"
member_of_prefetched
"
),
)
persons
=
group
.
generate_person_list_with_class_register_statistics
(
group
.
members
.
prefetch_related
(
"
primary_group__owners
"
,
Prefetch
(
"
member_of
"
,
queryset
=
relevant_groups
,
to_attr
=
"
member_of_prefetched
"
),
)
.
filter
(
member_of__in
=
request
.
user
.
person
.
owner_of
.
all
())
.
distinct
()
)
).
distinct
()
persons_for_group
=
[]
for
person
in
persons
:
person
.
set_object_permission_checker
(
checker
)
...
...
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