esrg-knights / Squire

A re-introduction of the WebApp for ESRG Knights of the Kitchen Table.
https://www.kotkt.nl/
GNU General Public License v3.0
11 stars 8 forks source link

Extended MembershipMiddleware to catch UserIsNotAMember exceptions #290

Closed DutcherNL closed 1 year ago

DutcherNL commented 1 year ago

Adjusted membershipMixin to throw error, which is to be catched by the Membership Middleware. This prevents accidental overwrites of the response when a user is not a member. Also removes the ugly redirect when a user is not allowed on a page.

codecov[bot] commented 1 year ago

Codecov Report

Base: 95.45% // Head: 95.44% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (bb32097) compared to base (7be7b52). Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #290 +/- ## ========================================== - Coverage 95.45% 95.44% -0.01% ========================================== Files 115 116 +1 Lines 4771 4765 -6 Branches 756 756 ========================================== - Hits 4554 4548 -6 Misses 148 148 Partials 69 69 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `95.44% <80.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/esrg-knights/Squire/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights) | Coverage Δ | | |---|---|---| | [squire/settings.py](https://codecov.io/gh/esrg-knights/Squire/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights#diff-c3F1aXJlL3NldHRpbmdzLnB5) | `100.00% <ø> (ø)` | | | [membership\_file/util.py](https://codecov.io/gh/esrg-knights/Squire/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights#diff-bWVtYmVyc2hpcF9maWxlL3V0aWwucHk=) | `80.95% <33.33%> (-6.93%)` | :arrow_down: | | [membership\_file/exceptions.py](https://codecov.io/gh/esrg-knights/Squire/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights#diff-bWVtYmVyc2hpcF9maWxlL2V4Y2VwdGlvbnMucHk=) | `100.00% <100.00%> (ø)` | | | [membership\_file/middleware.py](https://codecov.io/gh/esrg-knights/Squire/pull/290?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights#diff-bWVtYmVyc2hpcF9maWxlL21pZGRsZXdhcmUucHk=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=esrg-knights)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.