From cee0547f774e4744af360388fd55efb00b708617 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 15 Jun 2017 18:38:32 -0400 Subject: [PATCH] Password patch --- app/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views.py b/app/views.py index 5265ad7b..e1f2e264 100644 --- a/app/views.py +++ b/app/views.py @@ -1,6 +1,7 @@ import json from django.contrib.auth import login +from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from django.http import Http404 from django.shortcuts import render, redirect, get_object_or_404 @@ -122,6 +123,7 @@ def welcome(request): fuf = FirstUserForm(request.POST) if fuf.is_valid(): admin_user = fuf.save(commit=False) + admin_user.password = make_password(fuf.cleaned_data['password']) admin_user.is_superuser = admin_user.is_staff = True admin_user.save()