fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d950d9f
)
fix contact digest
author
Jan Szejko
<janek37@gmail.com>
Mon, 18 Dec 2017 19:04:39 +0000
(20:04 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Mon, 18 Dec 2017 19:04:39 +0000
(20:04 +0100)
contact/models.py
patch
|
blob
|
history
diff --git
a/contact/models.py
b/contact/models.py
index
8d89c8d
..
dbc48b9
100644
(file)
--- a/
contact/models.py
+++ b/
contact/models.py
@@
-2,7
+2,7
@@
import yaml
from hashlib import sha1
from django.db import models
import yaml
from hashlib import sha1
from django.db import models
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_unicode
, force_str
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from . import app_settings
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from . import app_settings
@@
-34,6
+34,7
@@
class Contact(models.Model):
def digest(self):
serialized_body = ';'.join(sorted('%s:%s' % item for item in self.body.iteritems()))
data = '%s%s%s%s%s' % (self.id, self.contact, serialized_body, self.ip, self.form_tag)
def digest(self):
serialized_body = ';'.join(sorted('%s:%s' % item for item in self.body.iteritems()))
data = '%s%s%s%s%s' % (self.id, self.contact, serialized_body, self.ip, self.form_tag)
+ data = force_str(data)
return sha1(data).hexdigest()
return sha1(data).hexdigest()