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
c4474646
Verified
Commit
c4474646
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Add distinct to permission-related queries in FilterRegisterObjectForm and AssignGroupRoleForm
parent
02b1b695
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!222
Resolve "MultipleObjectsReturned at /app/alsijil/me/ - get() returned more than one Group -- it returned 18!"
Pipeline
#26369
passed with warnings
3 years ago
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/apps/alsijil/forms.py
+6
-4
6 additions, 4 deletions
aleksis/apps/alsijil/forms.py
with
7 additions
and
4 deletions
CHANGELOG.rst
+
1
−
0
View file @
c4474646
...
...
@@ -13,6 +13,7 @@ Fixed
~~~~~
* The _Delete personal note_ action didn't work due to wrong usage of ``bulk_update``.
* Groups and persons were shown multiple times in some forms due to filtering by permissions.
`2.0rc4`_ - 2021-08-01
----------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/forms.py
+
6
−
4
View file @
c4474646
...
...
@@ -256,11 +256,13 @@ class AssignGroupRoleForm(forms.ModelForm):
)
else
:
persons
=
persons
.
filter
(
member_of__owners
=
self
.
request
.
user
.
person
)
self
.
fields
[
"
person
"
].
queryset
=
persons
self
.
fields
[
"
person
"
].
queryset
=
persons
.
distinct
()
if
"
groups
"
not
in
initial
:
groups
=
Group
.
objects
.
for_current_school_term_or_all
().
filter
(
owners
=
self
.
request
.
user
.
person
groups
=
(
Group
.
objects
.
for_current_school_term_or_all
()
.
filter
(
owners
=
self
.
request
.
user
.
person
)
.
distinct
()
)
self
.
fields
[
"
groups
"
].
queryset
=
groups
...
...
@@ -332,7 +334,7 @@ class FilterRegisterObjectForm(forms.Form):
|
Q
(
lessons__lesson_periods__substitutions__teachers
=
person
)
|
Q
(
events__teachers
=
person
)
|
Q
(
extra_lessons__teachers
=
person
)
)
)
.
distinct
()
elif
not
for_person
:
groups
=
Group
.
objects
.
all
()
self
.
fields
[
"
group
"
].
queryset
=
groups
...
...
This diff is collapsed.
Click to expand it.
Jonathan Weth
@hansegucker
mentioned in commit
dbff6199
·
3 years ago
mentioned in commit
dbff6199
mentioned in commit dbff619980897e19ac9b44dd6278d37701eaa975
Toggle commit list
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