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
f00c1468
Commit
f00c1468
authored
Feb 07, 2017
by
Ahsan Ulhaq
Committed by
Ned Batchelder
Feb 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unique constraint on email
ECOM-7085 (cherry picked from commit
d141eb15
)
parent
09c4c77b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
common/djangoapps/student/migrations/0010_auto_20170207_0458.py
+18
-0
openedx/core/lib/django_courseware_routers.py
+6
-4
No files found.
common/djangoapps/student/migrations/0010_auto_20170207_0458.py
0 → 100644
View file @
f00c1468
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'student'
,
'0009_auto_20170111_0422'
),
]
operations
=
[
migrations
.
RunSQL
(
"create unique index email on auth_user (email);"
,
"drop index email on auth_user;"
)
]
openedx/core/lib/django_courseware_routers.py
View file @
f00c1468
...
...
@@ -45,13 +45,15 @@ class StudentModuleHistoryExtendedRouter(object):
return
False
return
None
def
allow_migrate
(
self
,
db
,
model
):
# pylint: disable=unused-argument
def
allow_migrate
(
self
,
db
,
app_label
,
model_name
=
None
,
**
hints
):
# pylint: disable=unused-argument
"""
Only sync StudentModuleHistoryExtended to StudentModuleHistoryExtendedRouter.DATABASE_Name
"""
if
self
.
_is_csmh
(
model
):
return
db
==
self
.
DATABASE_NAME
elif
db
==
self
.
DATABASE_NAME
:
if
model_name
is
not
None
:
model
=
hints
.
get
(
'model'
)
if
self
.
_is_csmh
(
model
):
return
db
==
self
.
DATABASE_NAME
if
db
==
self
.
DATABASE_NAME
:
return
False
return
None
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