Skip to content

Avoid left join when filtering for channel permissions#2948

Merged
jredrejo merged 1 commit intolearningequality:hotfixesfrom
jredrejo:avoid_repeated_channels
Feb 15, 2021
Merged

Avoid left join when filtering for channel permissions#2948
jredrejo merged 1 commit intolearningequality:hotfixesfrom
jredrejo:avoid_repeated_channels

Conversation

@jredrejo
Copy link
Member

Description

filter_view_queryset was adding a left join on Invitations that was causing duplicated results when showing a list of channels.
This pr replaces the used query using only the list of pending invitations the user has.
In any case I wonder if we should show to the user channels that have pending invitations

By the way: this issue hadn't been seen before because admins don't have this problem and most of LE staff are admins when testing Studio

Issue Addressed (if applicable)

Closes #2899

Before/After Screenshots (if applicable)

Documented in the refered issue

Steps to Test

Login as a non-admin user
Look at the list of channels and check there are not repated channels in the list

@codecov
Copy link

codecov bot commented Feb 15, 2021

Codecov Report

Merging #2948 (c88820e) into hotfixes (28587f8) will increase coverage by 4.78%.
The diff coverage is 93.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           hotfixes    #2948      +/-   ##
============================================
+ Coverage     80.80%   85.58%   +4.78%     
============================================
  Files           281      299      +18     
  Lines         12659    15887    +3228     
============================================
+ Hits          10229    13597    +3368     
+ Misses         2430     2290     -140     
Impacted Files Coverage Δ
contentcuration/contentcuration/decorators.py 56.60% <50.00%> (-37.60%) ⬇️
...ntentcuration/contentcuration/db/models/manager.py 91.20% <90.98%> (-8.80%) ⬇️
contentcuration/contentcuration/forms.py 82.85% <94.31%> (+34.40%) ⬆️
contentcuration/contentcuration/api.py 92.06% <100.00%> (+1.43%) ⬆️
...tentcuration/contentcuration/context_processors.py 100.00% <100.00%> (ø)
...ontentcuration/contentcuration/db/advisory_lock.py 100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py 93.33% <100.00%> (-6.67%) ⬇️
...entcuration/contentcuration/db/models/functions.py 100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py 36.93% <0.00%> (-63.07%) ⬇️
contentcuration/contentcuration/utils/format.py 21.05% <0.00%> (-49.54%) ⬇️
... and 181 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fdaf7c...3ff36de. Read the comment docs.

@jredrejo jredrejo merged commit 9edb358 into learningequality:hotfixes Feb 15, 2021
@jredrejo jredrejo deleted the avoid_repeated_channels branch February 15, 2021 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some channels are listed 2 or 3 times in the "Import from other channels" browsing page

2 participants