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
e94d265f
Commit
e94d265f
authored
Oct 05, 2017
by
Troy Sankey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove our copy of the slugify() implementation
parent
cc2fe585
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
25 deletions
+3
-25
common/djangoapps/util/model_utils.py
+0
-22
lms/djangoapps/badges/events/course_complete.py
+1
-1
lms/djangoapps/courseware/module_render.py
+1
-1
lms/djangoapps/teams/models.py
+1
-1
No files found.
common/djangoapps/util/model_utils.py
View file @
e94d265f
"""
"""
Utilities for django models.
Utilities for django models.
"""
"""
import
re
import
unicodedata
from
django.conf
import
settings
from
django.conf
import
settings
from
django.dispatch
import
Signal
from
django.dispatch
import
Signal
from
django.utils.encoding
import
force_unicode
from
django.utils.safestring
import
mark_safe
from
django_countries.fields
import
Country
from
django_countries.fields
import
Country
from
eventtracking
import
tracker
from
eventtracking
import
tracker
...
@@ -171,20 +166,3 @@ def _get_truncated_setting_value(value, max_length=None):
...
@@ -171,20 +166,3 @@ def _get_truncated_setting_value(value, max_length=None):
return
value
[
0
:
max_length
],
True
return
value
[
0
:
max_length
],
True
else
:
else
:
return
value
,
False
return
value
,
False
# Taken from Django 1.8 source code because it's not supported in 1.4
def
slugify
(
value
):
"""Converts value into a string suitable for readable URLs.
Converts to ASCII. Converts spaces to hyphens. Removes characters that
aren't alphanumerics, underscores, or hyphens. Converts to lowercase.
Also strips leading and trailing whitespace.
Args:
value (string): String to slugify.
"""
value
=
force_unicode
(
value
)
value
=
unicodedata
.
normalize
(
'NFKD'
,
value
)
.
encode
(
'ascii'
,
'ignore'
)
.
decode
(
'ascii'
)
value
=
re
.
sub
(
r'[^\w\s-]'
,
''
,
value
)
.
strip
()
.
lower
()
return
mark_safe
(
re
.
sub
(
r'[-\s]+'
,
'-'
,
value
))
lms/djangoapps/badges/events/course_complete.py
View file @
e94d265f
...
@@ -5,7 +5,7 @@ import hashlib
...
@@ -5,7 +5,7 @@ import hashlib
import
logging
import
logging
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.
template.defaultfilters
import
slugify
from
django.
utils.text
import
slugify
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
badges.models
import
BadgeAssertion
,
BadgeClass
,
CourseCompleteImageConfiguration
from
badges.models
import
BadgeAssertion
,
BadgeClass
,
CourseCompleteImageConfiguration
...
...
lms/djangoapps/courseware/module_render.py
View file @
e94d265f
...
@@ -64,7 +64,7 @@ from student.roles import CourseBetaTesterRole
...
@@ -64,7 +64,7 @@ from student.roles import CourseBetaTesterRole
from
track
import
contexts
from
track
import
contexts
from
util
import
milestones_helpers
from
util
import
milestones_helpers
from
util.json_request
import
JsonResponse
from
util.json_request
import
JsonResponse
from
util.model_utils
import
slugify
from
django.utils.text
import
slugify
from
util.sandboxing
import
can_execute_unsafe_code
,
get_python_lib_zip
from
util.sandboxing
import
can_execute_unsafe_code
,
get_python_lib_zip
from
xblock_django.user_service
import
DjangoXBlockUserService
from
xblock_django.user_service
import
DjangoXBlockUserService
from
xmodule.contentstore.django
import
contentstore
from
xmodule.contentstore.django
import
contentstore
...
...
lms/djangoapps/teams/models.py
View file @
e94d265f
...
@@ -27,7 +27,7 @@ from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT
...
@@ -27,7 +27,7 @@ from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT
from
lms.djangoapps.teams.utils
import
emit_team_event
from
lms.djangoapps.teams.utils
import
emit_team_event
from
openedx.core.djangoapps.xmodule_django.models
import
CourseKeyField
from
openedx.core.djangoapps.xmodule_django.models
import
CourseKeyField
from
student.models
import
CourseEnrollment
,
LanguageField
from
student.models
import
CourseEnrollment
,
LanguageField
from
util.model_utils
import
slugify
from
django.utils.text
import
slugify
from
.errors
import
AlreadyOnTeamInCourse
,
ImmutableMembershipFieldException
,
NotEnrolledInCourseForTeam
from
.errors
import
AlreadyOnTeamInCourse
,
ImmutableMembershipFieldException
,
NotEnrolledInCourseForTeam
...
...
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