1. dwaiter
  2. django-bcrypt

Commits

Steve Losh  committed fac2870

Make the default setting retrieval more elegant.

  • Participants
  • Parent commits e6c6408
  • Branches default

Comments (0)

Files changed (1)

File django_bcrypt/models.py

View file
 from django.conf import settings
 
 
-try:
-    rounds = settings.BCRYPT_ROUNDS
-except AttributeError:
-    rounds = 12
-
+rounds = getattr(settings, "BCRYPT_ROUNDS", 12)
 _check_password = User.check_password
 
 def bcrypt_check_password(self, raw_password):