Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
aab6c54a
Commit
aab6c54a
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Plain Diff
Merge pull request #2545 from edx/ned/remove-tabs
Remove tabs.
parents
3938e84d
2f67d0aa
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/tests/test_utils_django.py
+13
-13
13 additions, 13 deletions
common/lib/xmodule/xmodule/tests/test_utils_django.py
common/lib/xmodule/xmodule/util/django.py
+9
-9
9 additions, 9 deletions
common/lib/xmodule/xmodule/util/django.py
with
22 additions
and
22 deletions
common/lib/xmodule/xmodule/tests/test_utils_django.py
+
13
−
13
View file @
aab6c54a
...
...
@@ -4,17 +4,17 @@ from nose.tools import assert_is_none
from
unittest
import
TestCase
class
UtilDjangoTests
(
TestCase
):
"""
Tests for methods exposed in util/django
"""
def
test_get_current_request
(
self
):
"""
Since we are running outside of Django assert that get_current_request returns None
"""
assert_is_none
(
get_current_request
())
"""
Tests for methods exposed in util/django
"""
def
test_get_current_request
(
self
):
"""
Since we are running outside of Django assert that get_current_request returns None
"""
assert_is_none
(
get_current_request
())
def
test_get_current_request_hostname
(
self
):
"""
Since we are running outside of Django assert that get_current_request_hostname returns None
"""
assert_is_none
(
get_current_request_hostname
())
def
test_get_current_request_hostname
(
self
):
"""
Since we are running outside of Django assert that get_current_request_hostname returns None
"""
assert_is_none
(
get_current_request_hostname
())
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/util/django.py
+
9
−
9
View file @
aab6c54a
"""
Exposes Django utilities for consumption in the xmodule library
NOTE: This file should only be imported into
'
django-safe
'
code, i.e. known that this code runs int the Django
NOTE: This file should only be imported into
'
django-safe
'
code, i.e. known that this code runs int the Django
runtime environment with the djangoapps in common configured to load
"""
...
...
@@ -9,12 +9,12 @@ from crum import get_current_request
def
get_current_request_hostname
():
"""
This method will return the hostname that was used in the current Django request
"""
hostname
=
None
request
=
get_current_request
()
if
request
:
hostname
=
request
.
META
.
get
(
'
HTTP_HOST
'
)
"""
This method will return the hostname that was used in the current Django request
"""
hostname
=
None
request
=
get_current_request
()
if
request
:
hostname
=
request
.
META
.
get
(
'
HTTP_HOST
'
)
return
hostname
return
hostname
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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