from django.contrib import admin
from .models import User

@admin.register(User)
class UserAdmin(admin.ModelAdmin):
    list_display = ("username", "email", "role", "is_superuser")

    def save_model(self, request, obj, form, change):
        if obj.is_superuser:
            obj.role = "landlord"
        super().save_model(request, obj, form, change)