Skip to content

Fix: Handling Existing Campaign Followers#1045

Open
abdullai-t wants to merge 4 commits intomainfrom
fix-campaign-follow
Open

Fix: Handling Existing Campaign Followers#1045
abdullai-t wants to merge 4 commits intomainfrom
fix-campaign-follow

Conversation

@abdullai-t
Copy link
Copy Markdown
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
Copy Markdown
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.
@codecov
Copy link
Copy Markdown

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