Merge pull request #21361 from edx/BOM-87

BOM-87
This commit is contained in:
Ayub
2019-08-19 19:43:57 +05:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
## mako
<%page expression_filter="h"/>
<%!
import six
from django.urls import reverse
from django.utils.translation import ugettext as _
%>
@@ -17,7 +18,7 @@ ${_("Student Support")}
<h1>${_("Student Support")}</h1>
<ul>
% for url in urls:
<li><a href="${url["url"]}">${unicode(url["name"])}</a>: ${unicode(url["description"])}</li>
<li><a href="${url["url"]}">${six.text_type(url["name"])}</a>: ${six.text_type(url["description"])}</li>
% endfor
</ul>
</section>

View File

@@ -160,7 +160,7 @@ class SafeCookieData(object):
))
return safe_cookie_data
def __unicode__(self):
def __str__(self):
"""
Returns a string serialization of the safe cookie data.
"""
@@ -202,7 +202,7 @@ class SafeCookieData(object):
hash_func = sha256()
for data_item in [self.version, self.session_id, user_id]:
hash_func.update(six.b(six.text_type(data_item)))
hash_func.update(b'|')
hash_func.update(six.b('|'))
return hash_func.hexdigest()
@staticmethod
@@ -317,7 +317,6 @@ class SafeSessionMiddleware(SessionMiddleware):
Step 4. Delete the cookie, if it's marked for deletion.
"""
response = super(SafeSessionMiddleware, self).process_response(request, response) # Step 1
if not _is_cookie_marked_for_deletion(request) and _is_cookie_present(response):