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

Develop #631

Merged
merged 2 commits into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions authentication/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
TwitterConnection,
UserProfile,
Wallet,
FarcasterConnection,
)


Expand Down Expand Up @@ -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 EnsConnectionAdmin and potentially other connection admin classes. Creating a base class could improve maintainability and reduce redundancy.

class BaseConnectionAdmin(admin.ModelAdmin):
    # Common admin configurations for connection models

class FarcasterConnectionAdmin(BaseConnectionAdmin):
    # Farcaster-specific configurations

list_display = ["pk", "user_profile", "user_wallet_address"]
search_fields = ["user_profile__username", "user_wallet_address"]


admin.site.register(Wallet, WalletAdmin)
admin.site.register(UserProfile, ProfileAdmin)
admin.site.register(BrightIDConnection, BrightIDConnectionAdmin)
admin.site.register(GitcoinPassportConnection, GitcoinPassportConnectionAdmin)
admin.site.register(TwitterConnection, TwitterConnectionAdmin)
admin.site.register(ENSConnection, EnsConnectionAdmin)
admin.site.register(FarcasterConnection, FarcasterConnectionAdmin)
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 organizing admin registrations in a consistent order.

To improve readability, consider alphabetizing the admin registrations or grouping them by type. This can make it easier to locate specific registrations in the future.

Loading