Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _set_password(user_model, user, email_template, length=8):
- password = user_model.objects.make_random_password(length=length)
- user.set_password(password)
- user.save()
- context = {
- 'email': user.email,
- 'password': password,
- }
- send_mail(email_template, [user.email], context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement