Skip to content

Commit

Permalink
Make it possible to create new user from django admin panel
Browse files Browse the repository at this point in the history
Django admin panel crashed error with null birthday,
when tried to add new custom user. Adding all fields
that are present on mylsa add user field it is now
possible to add custom user trough django admin panel.

Is mylsa page still neede as it seems it is shown only
to admin profiles?

Signed-off-by: Erkki Hietaranta <[email protected]>
  • Loading branch information
sbeach92 committed Feb 5, 2024
1 parent eb86846 commit 38a607d
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,44 @@ class CustomUserAdmin(UserAdmin):
{"fields": ("birthday",) + readonly_fields + ("marked_for_deletion_on",)},
),
)

add_fieldsets = (
(
"Data",
{
"classes": ("wide",),
"fields": (
"email",
"first_name",
"last_name",
"nick",
"mxid",
"language",
"municipality",
"is_active",
"is_staff",
"is_superuser",
"phone",
"bank_account",
'password1',
'password2',
),
},
),

(
"Dates",
{
"classes": ("wide",),
"fields": (
"birthday",
),

},
),

)

inlines = [ServiceSubscriptionInline]

actions = ["mark_for_deletion_on", "mark_for_deletion_off"]
Expand Down

0 comments on commit 38a607d

Please sign in to comment.