fix DeprecationWarning for django 1.4; update projects

This commit is contained in:
slav0nic 2012-04-23 14:28:40 +03:00
parent 5c243deb0d
commit bb030e3262
3 changed files with 6 additions and 6 deletions

View file

@ -1,12 +1,12 @@
from datetime import datetime
import os
import os.path
from hashlib import sha1
from django.db import models
from django.contrib.auth.models import User, Group
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.hashcompat import sha_constructor
from django.db.models.signals import post_save
from djangobb_forum.fields import AutoOneToOneField, ExtendedImageField, JSONField
@ -397,7 +397,7 @@ class Attachment(models.Model):
def save(self, *args, **kwargs):
super(Attachment, self).save(*args, **kwargs)
if not self.hash:
self.hash = sha_constructor(str(self.id) + settings.SECRET_KEY).hexdigest()
self.hash = sha1(str(self.id) + settings.SECRET_KEY).hexdigest()
super(Attachment, self).save(*args, **kwargs)
@models.permalink