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

Fix event-following bug by adding current user following status to event serializer #3214

Merged
merged 1 commit into from Feb 10, 2023

Conversation

eikhr
Copy link
Member

@eikhr eikhr commented Feb 9, 2023

There is a bug where the webapp does not correctly load the following status of the current user, if an event has a large number of followers. It is caused by pagination on the event follower endpoint, but I figured this was a better solution than loading all pages in the webapp.

This adds a field "following" on EventReadUserDetailedSerializer that is false when the current user is not following the event, and the id of the relevant EventFollow object if the user is following the event.

webkom/lego-webapp#3541 implements the needed front-end changes

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Base: 88.28% // Head: 88.29% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (905c7cc) compared to base (7e08ba1).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3214   +/-   ##
=======================================
  Coverage   88.28%   88.29%           
=======================================
  Files         658      658           
  Lines       20713    20727   +14     
=======================================
+ Hits        18287    18301   +14     
  Misses       2426     2426           
Impacted Files Coverage Δ
lego/apps/events/fields.py 90.78% <100.00%> (+0.55%) ⬆️
lego/apps/events/models.py 97.36% <100.00%> (+0.02%) ⬆️
lego/apps/events/serializers/events.py 96.77% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

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.

lgtm :shipit:

@eikhr eikhr merged commit 4f51a3c into master Feb 10, 2023
@eikhr eikhr deleted the following-bug branch February 10, 2023 12:41
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

2 participants