django-users-iag-usp 0.1.5__tar.gz → 0.1.7__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.
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/PKG-INFO +1 -1
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/pyproject.toml +1 -1
- django_users_iag_usp-0.1.7/src/ldap_user/admin.py +18 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/src/ldap_user/models.py +2 -2
- django_users_iag_usp-0.1.5/src/ldap_user/admin.py +0 -3
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/.gitignore +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/.python-version +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/README.md +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/manage.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/src/__init__.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/src/ldap_user/__init__.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/src/ldap_user/apps.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/tests/__init__.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/tests/conftest.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/tests/test_ldap_models.py +0 -0
- {django_users_iag_usp-0.1.5 → django_users_iag_usp-0.1.7}/uv.lock +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from django.contrib import admin
|
|
2
|
+
from django.contrib.auth.admin import UserAdmin
|
|
3
|
+
from .models import LdapUser
|
|
4
|
+
|
|
5
|
+
@admin.register(LdapUser)
|
|
6
|
+
class CustomUserAdmin(UserAdmin):
|
|
7
|
+
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
|
|
8
|
+
|
|
9
|
+
fieldsets = UserAdmin.fieldsets + (
|
|
10
|
+
('Informações Adicionais', {'fields': ('seu_campo_extra_1', 'seu_campo_extra_2')}),
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
add_fieldsets = UserAdmin.add_fieldsets + (
|
|
14
|
+
('Informações Adicionais', {'fields': ('seu_campo_extra_1', 'seu_campo_extra_2')}),
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
search_fields = ('username', 'first_name', 'last_name', 'email')
|
|
18
|
+
ordering = ('username',)
|
|
@@ -3,12 +3,12 @@ from django.db import models
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class LdapUser(AbstractUser):
|
|
6
|
-
|
|
6
|
+
pca_groups = models.TextField()
|
|
7
7
|
created_at = models.DateField(auto_now_add=True)
|
|
8
8
|
updated_at = models.DateField(auto_now=True)
|
|
9
9
|
|
|
10
10
|
def get_setor(self):
|
|
11
|
-
groups_striped = self.
|
|
11
|
+
groups_striped = self.pca_groups.replace(" ", "")
|
|
12
12
|
groups = groups_striped.split(",")
|
|
13
13
|
return groups
|
|
14
14
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|