Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
afc1c441
Commit
afc1c441
authored
Sep 02, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected language punctuation...again
ECOM-5466
parent
695ec99a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
course_discovery/apps/ietf_language_tags/migrations/0003_fix_language_tag_names.py
+2
-2
course_discovery/apps/ietf_language_tags/migrations/0005_fix_language_tag_names_again.py
+23
-0
No files found.
course_discovery/apps/ietf_language_tags/migrations/0003_fix_language_tag_names.py
View file @
afc1c441
...
@@ -9,7 +9,7 @@ def fix_tag_names(apps, schema_editor):
...
@@ -9,7 +9,7 @@ def fix_tag_names(apps, schema_editor):
LanguageTag
=
apps
.
get_model
(
'ietf_language_tags'
,
'LanguageTag'
)
LanguageTag
=
apps
.
get_model
(
'ietf_language_tags'
,
'LanguageTag'
)
for
tag
in
LanguageTag
.
objects
.
all
():
for
tag
in
LanguageTag
.
objects
.
all
():
tag
.
name
=
tag
.
name
.
replace
(
'
—
'
,
'-'
)
tag
.
name
=
tag
.
name
.
replace
(
'
–
'
,
'-'
)
tag
.
save
()
tag
.
save
()
...
@@ -19,5 +19,5 @@ class Migration(migrations.Migration):
...
@@ -19,5 +19,5 @@ class Migration(migrations.Migration):
]
]
operations
=
[
operations
=
[
migrations
.
RunPython
(
fix_tag_names
),
migrations
.
RunPython
(
fix_tag_names
,
migrations
.
RunPython
.
noop
),
]
]
course_discovery/apps/ietf_language_tags/migrations/0005_fix_language_tag_names_again.py
0 → 100644
View file @
afc1c441
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
def
fix_tag_names
(
apps
,
schema_editor
):
""" Replace dashes (—) in tag names with hyphens (-)."""
LanguageTag
=
apps
.
get_model
(
'ietf_language_tags'
,
'LanguageTag'
)
for
tag
in
LanguageTag
.
objects
.
all
():
tag
.
name
=
tag
.
name
.
replace
(
'–'
,
'-'
)
tag
.
save
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'ietf_language_tags'
,
'0004_add_chinese_tags'
),
]
operations
=
[
migrations
.
RunPython
(
fix_tag_names
,
migrations
.
RunPython
.
noop
),
]
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