pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.37k stars 3.01k forks source link

code to inline social info in admin user interface #2688

Closed mennucc closed 8 months ago

mennucc commented 3 years ago

dear all,

I propose this simple patch attached. 0001-add-InlineSocialAccountAdmin-for-showing-social-acco.patch

this creates a new admin interface that can be used to show social authentication inside the user admin interface

in my project I have a customized user called ColDocUser and I use it as follows:

from django.contrib.auth.admin import UserAdmin
from ColDocDjango.users import ColDocUser
from allauth.socialaccount.admin  import InlineSocialAccountAdmin
class ColDocUserAdmin(UserAdmin):
        model = ColDocUser
        inlines = [
            InlineSocialAccountAdmin,
        ]
admin.site.register(ColDocUser, ColDocUserAdmin)

it is useful

bye . a.

pennersr commented 1 year ago

Projects can implements this themselves, there is no need for allauth to force this out of the box.

mennucc commented 1 year ago

I think that there is a misunderstaning.

django-allauth is already shipping the class SocialAccountAdmin, it would make sense to also ship the class InlineSocialAccountAdmin.

The patch does not force anything onto users of django-allauth. If you apply the patch, then the users still need to activate that code as in the example in my first comment. It is just more convenient for them

In any case, thanks and bye. a.

pennersr commented 8 months ago

But, the SocialAccountAdmin that is shipped is actually used out of the box. The difference with your InlineSocialAccountAdmin is that it is a class that is not used, and projects can easily include something like that themselves.