1 from django.contrib import admin
2 from django.utils.safestring import mark_safe
3 from django.utils.translation import gettext as _
5 from .utils import generate_password
8 @admin.register(models.FtpUser)
9 class FtpUserAdmin(admin.ModelAdmin):
10 fields = ['login', 'created_at', 'last_seen_at', 'password', 'password_set_at']
11 readonly_fields = ['created_at', 'last_seen_at', 'password_set_at']
13 def save_model(self, request, obj, form, change):
15 pwd = obj.set_password(save=False)
19 _('Password for <strong>%(login)s</strong> set to: <input disabled value="%(password)s">.') % {
25 return super().save_model(request, obj, form, change)