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

added farcaster admin conenction #630

Merged
merged 1 commit into from
Sep 21, 2024
Merged

Conversation

Bob-six
Copy link
Collaborator

@Bob-six Bob-six commented Sep 21, 2024

Summary by Sourcery

Add FarcasterConnection to the admin interface, allowing management of Farcaster connections with list display and search capabilities.

New Features:

  • Introduce FarcasterConnectionAdmin to manage Farcaster connections in the admin interface.

Copy link
Contributor

sourcery-ai bot commented Sep 21, 2024

Reviewer's Guide by Sourcery

This pull request adds Farcaster admin connection functionality to the Django admin interface. It introduces a new admin model for FarcasterConnection and registers it in the admin site.

File-Level Changes

Change Details Files
Added FarcasterConnection to the admin interface
  • Imported FarcasterConnection model
  • Created FarcasterConnectionAdmin class with list_display and search_fields
  • Registered FarcasterConnection with the admin site
authentication/admin.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 @alimaktabi - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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.

@@ -53,9 +54,15 @@ class EnsConnectionAdmin(admin.ModelAdmin):
search_fields = ["user_profile__username", "user_wallet_address"]


class FarcasterConnectionAdmin(admin.ModelAdmin):
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider creating a base class for connection admin models to reduce code duplication.

The FarcasterConnectionAdmin class is very similar to other connection admin classes like EnsConnectionAdmin. Creating a base class could help reduce duplication and make it easier to add new connection types in the future.

class BaseConnectionAdmin(admin.ModelAdmin):
    list_display = ["pk", "user_profile", "user_wallet_address"]
    search_fields = ["user_profile__username", "user_wallet_address"]

class FarcasterConnectionAdmin(BaseConnectionAdmin):
    pass

@Bob-six Bob-six merged commit 5d6778d into develop Sep 21, 2024
1 check passed
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