Lifespark-Technologies / Infomed

Web portal that enables communication between hospitals and health authorities
MIT License
1 stars 1 forks source link

Fix create users #94

Closed kaashmonee closed 4 years ago

kaashmonee commented 4 years ago

This fixes a lot of the issues that @bl-nero was having earlier. The passwords are now stored as hashed values and require a different form to change.

@bl-nero's remark that

The fact that they don’t work means that they are not being stored in plain text, but it’s just that the form is somehow wrong.

was mostly correct. We still use a ModelForm, but the AccountAdmin inherits from UserAdmin as opposed to ModelAdmin. This allows us to specify Account creation and modification forms and gives us some user creation functionality right out of the box. It also ensures that the passwords to remain hashed and requires a different form to change them.