openwisp-users 1.2.1__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/CHANGES.rst +9 -0
  2. {openwisp_users-1.2.1/openwisp_users.egg-info → openwisp_users-1.2.2}/PKG-INFO +1 -1
  3. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/__init__.py +1 -1
  4. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/urls.py +8 -9
  5. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/admin.py +23 -5
  6. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_admin.py +16 -1
  7. {openwisp_users-1.2.1 → openwisp_users-1.2.2/openwisp_users.egg-info}/PKG-INFO +1 -1
  8. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/LICENSE +0 -0
  9. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/MANIFEST.in +0 -0
  10. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/README.rst +0 -0
  11. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/__init__.py +0 -0
  12. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/adapter.py +0 -0
  13. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/locale/de/LC_MESSAGES/django.po +0 -0
  14. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/locale/fur/LC_MESSAGES/django.po +0 -0
  15. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/locale/it/LC_MESSAGES/django.po +0 -0
  16. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/locale/ru/LC_MESSAGES/django.po +0 -0
  17. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/locale/sl/LC_MESSAGES/django.po +0 -0
  18. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/static/openwisp-users/accounts/css/change-password.css +0 -0
  19. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/static/openwisp-users/accounts/css/non-admin.css +0 -0
  20. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/base_message.txt +0 -0
  21. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/email_confirmation_message.html +0 -0
  22. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/email_confirmation_message.txt +0 -0
  23. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/email_confirmation_signup_message.html +0 -0
  24. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/password_expiration_message.html +0 -0
  25. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email/password_expiration_message.txt +0 -0
  26. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email_confirm.html +0 -0
  27. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/email_verification_success.html +0 -0
  28. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/login.html +0 -0
  29. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/logout_success.html +0 -0
  30. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/password_change.html +0 -0
  31. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/password_change_success.html +0 -0
  32. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/account/password_not_required.html +0 -0
  33. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/templates/allauth/layouts/base.html +0 -0
  34. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/accounts/views.py +0 -0
  35. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/__init__.py +0 -0
  36. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/authentication.py +0 -0
  37. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/filters.py +0 -0
  38. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/mixins.py +0 -0
  39. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/permissions.py +0 -0
  40. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/serializers.py +0 -0
  41. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/swagger.py +0 -0
  42. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/throttling.py +0 -0
  43. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/urls.py +0 -0
  44. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/api/views.py +0 -0
  45. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/apps.py +0 -0
  46. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/backends.py +0 -0
  47. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/base/__init__.py +0 -0
  48. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/base/models.py +0 -0
  49. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/locale/de/LC_MESSAGES/django.po +0 -0
  50. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/locale/fur/LC_MESSAGES/django.po +0 -0
  51. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/locale/it/LC_MESSAGES/django.po +0 -0
  52. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/locale/ru/LC_MESSAGES/django.po +0 -0
  53. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/locale/sl/LC_MESSAGES/django.po +0 -0
  54. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/management/__init__.py +0 -0
  55. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/management/commands/__init__.py +0 -0
  56. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/management/commands/export_users.py +0 -0
  57. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/middleware.py +0 -0
  58. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0001_initial.py +0 -0
  59. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0002_auto_20180508_2017.py +0 -0
  60. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0003_default_organization.py +0 -0
  61. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0004_default_groups.py +0 -0
  62. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0005_user_phone_number.py +0 -0
  63. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0006_id_email_index_together.py +0 -0
  64. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0007_unique_email.py +0 -0
  65. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0008_update_admins_permissions.py +0 -0
  66. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0009_create_organization_owners.py +0 -0
  67. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0010_allow_admins_change_organization.py +0 -0
  68. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0011_user_first_name_150_max_length.py +0 -0
  69. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0012_user_location_max_length_256.py +0 -0
  70. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0013_user_birth_date.py +0 -0
  71. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0014_user_notes.py +0 -0
  72. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0015_alter_organization_users_alter_organizationuser_user.py +0 -0
  73. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0016_organizationinvitation.py +0 -0
  74. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0017_user_language.py +0 -0
  75. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0018_allow_operator_view_organisation.py +0 -0
  76. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0019_user_password_updated.py +0 -0
  77. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0020_populate_password_updated_field.py +0 -0
  78. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/0021_rename_user_id_email_openwisp_us_id_06c07a_idx.py +0 -0
  79. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/migrations/__init__.py +0 -0
  80. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/mixins.py +0 -0
  81. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/models.py +0 -0
  82. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/multitenancy.py +0 -0
  83. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/password_validation.py +0 -0
  84. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/settings.py +0 -0
  85. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/static/openwisp-users/css/admin.css +0 -0
  86. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/static/openwisp-users/css/change-password.css +0 -0
  87. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/static/openwisp-users/js/addform.js +0 -0
  88. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/static/openwisp-users/js/org-autocomplete.js +0 -0
  89. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tasks.py +0 -0
  90. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/templates/admin/action_confirmation.html +0 -0
  91. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/templates/admin/login.html +0 -0
  92. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/templates/admin/openwisp_users/user/change_form.html +0 -0
  93. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/__init__.py +0 -0
  94. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_accounts.py +0 -0
  95. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_adapter.py +0 -0
  96. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_api/__init__.py +0 -0
  97. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_api/test_api.py +0 -0
  98. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_api/test_authentication.py +0 -0
  99. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_api/test_throttling.py +0 -0
  100. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_api/test_views.py +0 -0
  101. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_backends.py +0 -0
  102. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_commands.py +0 -0
  103. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_middlewares.py +0 -0
  104. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/test_models.py +0 -0
  105. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/tests/utils.py +0 -0
  106. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/utils.py +0 -0
  107. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/views.py +0 -0
  108. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users/widgets.py +0 -0
  109. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users.egg-info/SOURCES.txt +0 -0
  110. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users.egg-info/dependency_links.txt +0 -0
  111. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users.egg-info/not-zip-safe +0 -0
  112. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users.egg-info/requires.txt +0 -0
  113. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/openwisp_users.egg-info/top_level.txt +0 -0
  114. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/pyproject.toml +0 -0
  115. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/requirements.txt +0 -0
  116. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/setup.cfg +0 -0
  117. {openwisp_users-1.2.1 → openwisp_users-1.2.2}/setup.py +0 -0
@@ -1,6 +1,15 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ Version 1.2.2 [2026-04-25]
5
+ --------------------------
6
+
7
+ Bugfixes
8
+ ~~~~~~~~
9
+
10
+ - Added SocialAccount inline to UserAdmin when needed `#501
11
+ <https://github.com/openwisp/openwisp-users/issues/501>`_
12
+
4
13
  Version 1.2.1 [2026-04-22]
5
14
  --------------------------
6
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openwisp-users
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Provides basic multi-tenancy features for OpenWISP (using the Django web-framework)
5
5
  Home-page: http://openwisp.org
6
6
  Download-URL: https://github.com/openwisp/openwisp-users/releases
@@ -1,4 +1,4 @@
1
- VERSION = (1, 2, 1, "final")
1
+ VERSION = (1, 2, 2, "final")
2
2
  __version__ = VERSION # alias
3
3
 
4
4
 
@@ -77,12 +77,11 @@ urlpatterns = [
77
77
 
78
78
  if app_settings.SOCIALACCOUNT_ENABLED:
79
79
  urlpatterns += [path("social/", include("allauth.socialaccount.urls"))]
80
-
81
- for provider in providers.registry.get_class_list():
82
- try:
83
- prov_mod = import_module(provider.get_package() + ".urls")
84
- except ImportError:
85
- continue
86
- prov_urlpatterns = getattr(prov_mod, "urlpatterns", None)
87
- if prov_urlpatterns:
88
- urlpatterns += prov_urlpatterns
80
+ for provider in providers.registry.get_class_list():
81
+ try:
82
+ prov_mod = import_module(provider.get_package() + ".urls")
83
+ except ImportError:
84
+ continue
85
+ prov_urlpatterns = getattr(prov_mod, "urlpatterns", None)
86
+ if prov_urlpatterns:
87
+ urlpatterns += prov_urlpatterns
@@ -652,14 +652,32 @@ if admin.site.is_registered(EmailAddress):
652
652
  admin.site.unregister(EmailAddress)
653
653
 
654
654
  if allauth_settings.SOCIALACCOUNT_ENABLED:
655
- socialaccount_models = [
655
+ _unregister_socialaccount_models = [
656
656
  ("socialaccount", "SocialToken"),
657
657
  ("socialaccount", "SocialAccount"),
658
658
  ]
659
- # Allow managing secrets if OAuth/SAML is enabled
660
- if not app_settings.SOCIALACCOUNT_ADMIN_NEEDED:
661
- socialaccount_models.append(("socialaccount", "SocialApp"))
662
- for model in socialaccount_models:
659
+ # allauth OAuth/SAML not enabled
660
+ if not app_settings.SOCIALACCOUNT_ADMIN_NEEDED: # pragma: no cover
661
+ _unregister_socialaccount_models.append(("socialaccount", "SocialApp"))
662
+ # allauth OAuth/SAML enabled
663
+ else:
664
+ from allauth.socialaccount.models import SocialAccount
665
+
666
+ class SocialAccountInline(admin.StackedInline):
667
+ model = SocialAccount
668
+ extra = 0
669
+ readonly_fields = ("provider", "uid", "extra_data")
670
+
671
+ def has_add_permission(self, request, obj=None):
672
+ return False
673
+
674
+ def has_delete_permission(self, request, obj=None):
675
+ return False
676
+
677
+ UserAdmin.inlines.append(SocialAccountInline)
678
+
679
+ # Un-register cluttering socialaccount models
680
+ for model in _unregister_socialaccount_models:
663
681
  model_class = apps.get_model(*model)
664
682
  if admin.site.is_registered(model_class):
665
683
  admin.site.unregister(model_class)
@@ -73,7 +73,7 @@ class TestUsersAdmin(
73
73
 
74
74
  @property
75
75
  def add_user_inline_params(self):
76
- return {
76
+ params = {
77
77
  "emailaddress_set-TOTAL_FORMS": 0,
78
78
  "emailaddress_set-INITIAL_FORMS": 0,
79
79
  "emailaddress_set-MIN_NUM_FORMS": 0,
@@ -83,6 +83,19 @@ class TestUsersAdmin(
83
83
  f"{self.app_label}_organizationuser-MIN_NUM_FORMS": 0,
84
84
  f"{self.app_label}_organizationuser-MAX_NUM_FORMS": 0,
85
85
  }
86
+ self._add_socialaccount_inline_params(params)
87
+ return params
88
+
89
+ def _add_socialaccount_inline_params(self, params):
90
+ if app_settings.SOCIALACCOUNT_ADMIN_NEEDED:
91
+ params.update(
92
+ {
93
+ "socialaccount_set-TOTAL_FORMS": 0,
94
+ "socialaccount_set-INITIAL_FORMS": 0,
95
+ "socialaccount_set-MIN_NUM_FORMS": 0,
96
+ "socialaccount_set-MAX_NUM_FORMS": 0,
97
+ }
98
+ )
86
99
 
87
100
  def test_admin_add_user_auto_email(self):
88
101
  admin = self._create_admin()
@@ -1702,6 +1715,7 @@ class TestBasicUsersIntegration(
1702
1715
 
1703
1716
  app_label = "openwisp_users"
1704
1717
  is_integration_test = True
1718
+ _add_socialaccount_inline_params = TestUsersAdmin._add_socialaccount_inline_params
1705
1719
 
1706
1720
  def _get_user_edit_form_inline_params(self, user, organization):
1707
1721
  params = {
@@ -1740,6 +1754,7 @@ class TestBasicUsersIntegration(
1740
1754
  f"{self.app_label}_organizationuser-0-user": str(user.pk),
1741
1755
  }
1742
1756
  )
1757
+ self._add_socialaccount_inline_params(params)
1743
1758
  return params
1744
1759
 
1745
1760
  def test_change_user(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openwisp-users
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Provides basic multi-tenancy features for OpenWISP (using the Django web-framework)
5
5
  Home-page: http://openwisp.org
6
6
  Download-URL: https://github.com/openwisp/openwisp-users/releases
File without changes
File without changes
File without changes