from django.contrib import admin
from .models import Employee, Role


class RoleAdmin(admin.ModelAdmin):
    list_display = ("name",)


class EmployeeAdmin(admin.ModelAdmin):
    list_display = ("username", "first_name", "last_name", "email", 'level', 'score',)
    fieldsets = (
        (None, {'fields': ('username', 'email', 'password')}),
        ('Personal info', {'fields': ('first_name',
                                      'last_name',
                                      'role',
                                      'skype_id',
                                      'avatar',
                                      'categories')}),
        ('Personal score', {'fields': ('last_month_score',
                                       'current_month_score',
                                       'level',
                                       'score')}),
        ('Permissions', {'fields': ('groups',
                                    'user_permissions',
                                    'is_superuser',
                                    'is_staff',
                                    'is_active',)}),
        ('History', {'fields': ('date_joined', 'last_login')})
    )

admin.site.register(Employee, EmployeeAdmin)
admin.site.register(Role, RoleAdmin)

@@ -1,12 +1,37 @@
+from django import forms%0A
 from django.
@@ -88,16 +88,360 @@
  Role%0A%0A%0A
+class UserCreationForm(forms.ModelForm):%0A    class Meta:%0A        model = Employee%0A        fields = ('username', 'password',)%0A%0A    def save(self, commit=True):%0A        user = super(UserCreationForm, self).save(commit=False)%0A        user.set_password(self.cleaned_data%5B'password'%5D)%0A        if commit:%0A            user.save()%0A        return user%0A%0A
 class Ro
@@ -529,32 +529,60 @@
 in.ModelAdmin):%0A
+    form = UserCreationForm%0A
     list_display

Fix employee form error about password hashing