Rename MD5_SALT to HASH_SALT

(imported from commit 3112cd805614c3057a9eb8f1b251381f48ab3173)
This commit is contained in:
Keegan McAllister 2012-09-21 11:08:02 -04:00
parent f1476963bf
commit 3cbc56a866
3 changed files with 6 additions and 4 deletions

View File

@ -97,7 +97,9 @@ STATICFILES_FINDERS = (
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
MD5_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# A fixed salt used for hashing in certain places, e.g. email-based
# username generation.
HASH_SALT = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (

View File

@ -87,7 +87,7 @@ class UserProfile(models.Model):
Subscription(userprofile=profile, recipient=recipient).save()
def create_user(email, password, realm, full_name, short_name):
username = hashlib.md5(settings.MD5_SALT + email).hexdigest()
username = hashlib.md5(settings.HASH_SALT + email).hexdigest()
user = User.objects.create_user(username=username, password=password,
email=email)
user.save()
@ -156,7 +156,7 @@ class Zephyr(models.Model):
'instance' : self.instance,
'content' : self.content,
'timestamp' : calendar.timegm(self.pub_date.timetuple()),
'gravatar_hash' : hashlib.md5(settings.MD5_SALT + self.sender.user.email).hexdigest(),
'gravatar_hash' : hashlib.md5(settings.HASH_SALT + self.sender.user.email).hexdigest(),
}
class UserMessage(models.Model):

View File

@ -113,7 +113,7 @@ def home(request):
return render_to_response('zephyr/index.html',
{'zephyr_array' : zephyr_json,
'user_profile': user_profile,
'email_hash' : hashlib.md5(settings.MD5_SALT + user_profile.user.email).hexdigest(),
'email_hash' : hashlib.md5(settings.HASH_SALT + user_profile.user.email).hexdigest(),
'people' : simplejson.dumps(people),
'classes' : simplejson.dumps(classes),
'instances' : simplejson.dumps(instances)},