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 gitcoinPassport problem #632

Merged
merged 1 commit into from
Sep 21, 2024
Merged

Conversation

PooyaFekri
Copy link
Collaborator

@PooyaFekri PooyaFekri commented Sep 21, 2024

Summary by Sourcery

Fix the Gitcoin Passport score retrieval by updating the method used to obtain the score.

Bug Fixes:

  • Fix the issue with retrieving the Gitcoin Passport score by replacing the method call to get_score with submit_passport.

@PooyaFekri PooyaFekri merged commit ca9b8e6 into develop Sep 21, 2024
Copy link
Contributor

sourcery-ai bot commented Sep 21, 2024

Reviewer's Guide by Sourcery

This pull request modifies the GitcoinPassportConnection class in the authentication/models.py file to fix an issue with the Gitcoin Passport score retrieval. The change replaces the get_score method with submit_passport method, which may indicate a change in the underlying API or a different approach to obtaining the score.

File-Level Changes

Change Details Files
Updated the score property method in GitcoinPassportConnection class
  • Replaced get_score method with submit_passport method
  • Changed variable name from score_tuple to _score
  • Removed conditional check and tuple indexing
  • Directly return the _score value
authentication/models.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @PooyaFekri - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Could you provide more context on why get_score was replaced with submit_passport? Understanding the reasons behind this API change would be helpful.
  • The original code included error handling (fallback to 0.0 if score_tuple was falsy). Consider if similar error handling is needed with the new submit_passport method.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +236 to +237
_score = self.driver.submit_passport(self.user_wallet_address)
return _score
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)

Suggested change
_score = self.driver.submit_passport(self.user_wallet_address)
return _score
return self.driver.submit_passport(self.user_wallet_address)

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.

1 participant