Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give permission to see Allergies for Event to Responsible Group #3495

Merged
merged 4 commits into from Oct 12, 2023

Conversation

danielyanghansen
Copy link
Member

@danielyanghansen danielyanghansen commented Sep 27, 2023

Backend checks if user is part of responsible group when delegating authorization to view allergies.

The corresponding serializer has also been updated to include the "ResponsibleGroup" field so that frontend also can check if user should be able to see the allergy tab

Resolves: ABA-589

Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to see some unit tests as well😁

lego/apps/events/models.py Outdated Show resolved Hide resolved
lego/apps/events/models.py Outdated Show resolved Hide resolved
@Arashfa0301
Copy link
Contributor

Looks good to me :)

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (6abb9ef) 88.20% compared to head (bf78d3f) 88.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3495   +/-   ##
=======================================
  Coverage   88.20%   88.21%           
=======================================
  Files         666      666           
  Lines       21069    21083   +14     
=======================================
+ Hits        18584    18598   +14     
  Misses       2485     2485           
Files Coverage Δ
lego/apps/events/models.py 97.22% <100.00%> (+0.02%) ⬆️
lego/apps/events/serializers/events.py 96.98% <100.00%> (+0.01%) ⬆️
lego/apps/events/tests/test_events_api.py 89.47% <100.00%> (+0.07%) ⬆️
lego/apps/events/views.py 82.93% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@itsisak itsisak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM💯

@jonasdeluna
Copy link
Member

jonasdeluna commented Sep 28, 2023

Resolves: ABA-589

@linear
Copy link

linear bot commented Sep 28, 2023

Signed-off-by: Daniel Yang Hansen <daniel.yang.hansen@gmail.com>
@danielyanghansen danielyanghansen force-pushed the Event_ResponsibleGroupCanSeeAllergies branch from 2d48d51 to efb0226 Compare October 4, 2023 17:40
Signed-off-by: Daniel Yang Hansen <daniel.yang.hansen@gmail.com>
Signed-off-by: Daniel Yang Hansen <daniel.yang.hansen@gmail.com>
Signed-off-by: Daniel Yang Hansen <daniel.yang.hansen@gmail.com>
@danielyanghansen
Copy link
Member Author

Tests run fine (tox -e tests)

@danielyanghansen danielyanghansen merged commit 9746f9b into master Oct 12, 2023
3 checks passed
@danielyanghansen danielyanghansen deleted the Event_ResponsibleGroupCanSeeAllergies branch October 12, 2023 10:42
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.

None yet

5 participants