Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
751890b3
Commit
751890b3
authored
Mar 11, 2016
by
Attiya Ishaque
Committed by
attiyaishaque
Mar 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Email address with '+' is accepted by Student Support.
parent
a1458b99
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
lms/djangoapps/certificates/tests/test_support_views.py
+15
-0
lms/djangoapps/certificates/views/support.py
+1
-1
lms/djangoapps/support/views/certificate.py
+2
-1
No files found.
lms/djangoapps/certificates/tests/test_support_views.py
View file @
751890b3
...
@@ -159,6 +159,21 @@ class CertificateSearchTests(CertificateSupportTestCase):
...
@@ -159,6 +159,21 @@ class CertificateSearchTests(CertificateSupportTestCase):
else
:
else
:
self
.
assertEqual
(
response
.
status_code
,
400
)
self
.
assertEqual
(
response
.
status_code
,
400
)
def
test_search_with_plus_sign
(
self
):
"""
Test that email address that contains '+' accepted by student support
"""
self
.
student
.
email
=
"student+student@example.com"
self
.
student
.
save
()
# pylint: disable=no-member
response
=
self
.
_search
(
self
.
student
.
email
)
self
.
assertEqual
(
response
.
status_code
,
200
)
results
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
len
(
results
),
1
)
retrieved_data
=
results
[
0
]
self
.
assertEqual
(
retrieved_data
[
"username"
],
self
.
STUDENT_USERNAME
)
def
test_results
(
self
):
def
test_results
(
self
):
response
=
self
.
_search
(
self
.
STUDENT_USERNAME
)
response
=
self
.
_search
(
self
.
STUDENT_USERNAME
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
...
...
lms/djangoapps/certificates/views/support.py
View file @
751890b3
...
@@ -85,7 +85,7 @@ def search_certificates(request):
...
@@ -85,7 +85,7 @@ def search_certificates(request):
]
]
"""
"""
user_filter
=
request
.
GET
.
get
(
"user"
,
""
)
user_filter
=
urllib
.
unquote
(
urllib
.
quote_plus
(
request
.
GET
.
get
(
"user"
,
""
))
)
if
not
user_filter
:
if
not
user_filter
:
msg
=
_
(
"user is not given."
)
msg
=
_
(
"user is not given."
)
return
HttpResponseBadRequest
(
msg
)
return
HttpResponseBadRequest
(
msg
)
...
...
lms/djangoapps/support/views/certificate.py
View file @
751890b3
...
@@ -6,6 +6,7 @@ from django.utils.decorators import method_decorator
...
@@ -6,6 +6,7 @@ from django.utils.decorators import method_decorator
from
edxmako.shortcuts
import
render_to_response
from
edxmako.shortcuts
import
render_to_response
from
support.decorators
import
require_support_permission
from
support.decorators
import
require_support_permission
import
urllib
class
CertificatesSupportView
(
View
):
class
CertificatesSupportView
(
View
):
...
@@ -30,7 +31,7 @@ class CertificatesSupportView(View):
...
@@ -30,7 +31,7 @@ class CertificatesSupportView(View):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
"""Render the certificates support view. """
"""Render the certificates support view. """
context
=
{
context
=
{
"user_filter"
:
request
.
GET
.
get
(
"user"
,
""
),
"user_filter"
:
urllib
.
unquote
(
urllib
.
quote_plus
(
request
.
GET
.
get
(
"user"
,
""
))
),
"course_filter"
:
request
.
GET
.
get
(
"course_id"
,
""
)
"course_filter"
:
request
.
GET
.
get
(
"course_id"
,
""
)
}
}
return
render_to_response
(
"support/certificates.html"
,
context
)
return
render_to_response
(
"support/certificates.html"
,
context
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment