~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to pybb/models.py

  • Committer: franku
  • Date: 2019-09-02 19:54:01 UTC
  • mto: This revision was merged to the branch mainline in revision 549.
  • Revision ID: somal@arcor.de-20190902195401-og2817ghsff3yuvz
simplified attachment hash

Show diffs side-by-side

added added

removed removed

Lines of Context:
403
403
        super(Attachment, self).save(*args, **kwargs)
404
404
        if not self.hash:
405
405
            self.hash = hashlib.sha1(
406
 
                str(self.id).encode('utf-8') + settings.SECRET_KEY.encode('utf-8')).hexdigest()
 
406
                bytes(self.id) + settings.SECRET_KEY.encode('utf-8')).hexdigest()
407
407
        super(Attachment, self).save(*args, **kwargs)
408
408
 
409
409
    def __str__(self):