1
0
mirror of https://github.com/django/django.git synced 2025-10-27 07:36:08 +00:00

Fixed #29324 -- Made SECRET_KEY validation lazy (on first access).

This commit is contained in:
Florian Apolloner
2020-07-29 09:06:54 +02:00
committed by GitHub
parent 9c9a3fe118
commit 948a874425
5 changed files with 26 additions and 17 deletions

View File

@@ -12,7 +12,10 @@ class PasswordResetTokenGenerator:
"""
key_salt = "django.contrib.auth.tokens.PasswordResetTokenGenerator"
algorithm = 'sha256'
secret = settings.SECRET_KEY
secret = None
def __init__(self):
self.secret = self.secret or settings.SECRET_KEY
def make_token(self, user):
"""