Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
05e1ec5b
Commit
05e1ec5b
authored
5 years ago
by
Nimisha Asthagiri
Browse files
Options
Downloads
Patches
Plain Diff
Fix "TypeError: cannot use a string pattern on a bytes-like object" in cookies.py
parent
5febcce2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/user_authn/cookies.py
+4
-3
4 additions, 3 deletions
openedx/core/djangoapps/user_authn/cookies.py
with
4 additions
and
3 deletions
openedx/core/djangoapps/user_authn/cookies.py
+
4
−
3
View file @
05e1ec5b
...
...
@@ -74,7 +74,7 @@ def delete_logged_in_cookies(response):
"""
for
cookie_name
in
ALL_LOGGED_IN_COOKIE_NAMES
:
response
.
delete_cookie
(
cookie_name
.
encode
(
'
utf-8
'
)
,
cookie_name
,
path
=
'
/
'
,
domain
=
settings
.
SESSION_COOKIE_DOMAIN
)
...
...
@@ -139,6 +139,7 @@ def set_logged_in_cookies(request, response, user):
# Note: The user may not yet be set on the request object by this time,
# especially during third party authentication. So use the user object
# that is passed in when needed.
if
user
.
is_authenticated
and
not
user
.
is_anonymous
:
# JWT cookies expire at the same time as other login-related cookies
...
...
@@ -182,7 +183,7 @@ def _set_deprecated_user_info_cookie(response, request, user, cookie_settings):
"""
user_info
=
_get_user_info_cookie_data
(
request
,
user
)
response
.
set_cookie
(
settings
.
EDXMKTG_USER_INFO_COOKIE_NAME
.
encode
(
'
utf-8
'
)
,
settings
.
EDXMKTG_USER_INFO_COOKIE_NAME
,
json
.
dumps
(
user_info
),
**
cookie_settings
)
...
...
@@ -196,7 +197,7 @@ def _set_deprecated_logged_in_cookie(response, cookie_settings):
# In the future, we should be able to replace this with the "user info"
# cookie set below.
response
.
set_cookie
(
settings
.
EDXMKTG_LOGGED_IN_COOKIE_NAME
.
encode
(
'
utf-8
'
)
,
settings
.
EDXMKTG_LOGGED_IN_COOKIE_NAME
,
'
true
'
,
**
cookie_settings
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment