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: Handling Existing Campaign Followers #1045

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abdullai-t
Copy link
Contributor

@abdullai-t abdullai-t commented Jun 6, 2024

Summary / Highlights

This pull request fixes the bug that returns success when a user subscribes to a campaign with the same information multiple times.

Details (Give details about what this PR accomplishes, include any screenshots etc)

Testing Steps (Provide details on how your changes can be tested)

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've tested my changes manually.
  • I've added unit tests to my PR.
Transparency (Project board)
  • I've given my PR a meaningful title.
  • I linked this PR to the relevant issue.
  • I moved the linked issue from the "Sprint backlog" to "In progress" when I started this.
  • I moved the linked issue to "QA Verification" now that it is ready to merge.

Added error handling to prevent duplicate campaign followers. This is achieved by returning an error if a 'get_or_create' operation yields an existent campaign follower. This will minimize potential conflicts in the CampaignFollow objects.
@abdullai-t abdullai-t marked this pull request as draft June 7, 2024 10:39
@archx3
Copy link
Contributor

archx3 commented Jun 19, 2024

@abdullai-t any update on this PR?

Modified the test_campaigns integration test to include email within the payload for the "campaigns.follow" endpoint. The changes were made for both community admin and user test scenarios.
@abdullai-t abdullai-t marked this pull request as ready for review July 22, 2024 14:27
The python-bidi library has been added to the project's dependencies in the requirements.txt file.
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.23%. Comparing base (95e9974) to head (4c89215).

Files Patch % Lines
src/api/store/campaign.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1045      +/-   ##
==========================================
- Coverage   55.25%   55.23%   -0.02%     
==========================================
  Files         440      440              
  Lines       32608    32610       +2     
==========================================
- Hits        18017    18013       -4     
- Misses      14591    14597       +6     

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

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.

2 participants