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
b9b87f9b
Commit
b9b87f9b
authored
Apr 07, 2016
by
Muzaffar yousaf
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11949 from edx/fix-migrations
Making migrations in-sync with models.
parents
68ae1325
2e0a9b26
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
131 additions
and
5 deletions
+131
-5
common/djangoapps/third_party_auth/admin.py
+17
-1
common/djangoapps/third_party_auth/models.py
+2
-2
common/djangoapps/util/tests/test_db.py
+18
-1
lms/djangoapps/commerce/migrations/0003_auto_20160329_0709.py
+18
-0
lms/djangoapps/lti_provider/migrations/0002_auto_20160325_0407.py
+20
-0
openedx/core/djangoapps/ccxcon/migrations/0002_auto_20160325_0407.py
+18
-0
openedx/core/djangoapps/coursetalk/migrations/0002_auto_20160325_0631.py
+19
-0
openedx/core/djangoapps/credentials/migrations/0002_auto_20160325_0631.py
+18
-0
requirements/edx/base.txt
+1
-1
No files found.
common/djangoapps/third_party_auth/admin.py
View file @
b9b87f9b
...
...
@@ -13,14 +13,23 @@ from .models import (
SAMLConfiguration
,
SAMLProviderData
,
LTIProviderConfig
,
ProviderApiPermissions
ProviderApiPermissions
,
_PSA_OAUTH2_BACKENDS
,
_PSA_SAML_BACKENDS
)
from
.tasks
import
fetch_saml_metadata
from
third_party_auth.provider
import
Registry
class
OAuth2ProviderConfigForm
(
forms
.
ModelForm
):
""" Django Admin form class for OAuth2ProviderConfig """
backend_name
=
forms
.
ChoiceField
(
choices
=
((
name
,
name
)
for
name
in
_PSA_OAUTH2_BACKENDS
))
class
OAuth2ProviderConfigAdmin
(
KeyedConfigurationModelAdmin
):
""" Django Admin class for OAuth2ProviderConfig """
form
=
OAuth2ProviderConfigForm
def
get_list_display
(
self
,
request
):
""" Don't show every single field in the admin change list """
return
(
...
...
@@ -31,8 +40,15 @@ class OAuth2ProviderConfigAdmin(KeyedConfigurationModelAdmin):
admin
.
site
.
register
(
OAuth2ProviderConfig
,
OAuth2ProviderConfigAdmin
)
class
SAMLProviderConfigForm
(
forms
.
ModelForm
):
""" Django Admin form class for SAMLProviderConfig """
backend_name
=
forms
.
ChoiceField
(
choices
=
((
name
,
name
)
for
name
in
_PSA_SAML_BACKENDS
))
class
SAMLProviderConfigAdmin
(
KeyedConfigurationModelAdmin
):
""" Django Admin class for SAMLProviderConfig """
form
=
SAMLProviderConfigForm
def
get_list_display
(
self
,
request
):
""" Don't show every single field in the admin change list """
return
(
...
...
common/djangoapps/third_party_auth/models.py
View file @
b9b87f9b
...
...
@@ -212,7 +212,7 @@ class OAuth2ProviderConfig(ProviderConfig):
prefix
=
'oa2'
KEY_FIELDS
=
(
'backend_name'
,
)
# Backend name is unique
backend_name
=
models
.
CharField
(
max_length
=
50
,
choices
=
[(
name
,
name
)
for
name
in
_PSA_OAUTH2_BACKENDS
],
blank
=
False
,
db_index
=
True
,
max_length
=
50
,
blank
=
False
,
db_index
=
True
,
help_text
=
(
"Which python-social-auth OAuth2 provider backend to use. "
"The list of backend choices is determined by the THIRD_PARTY_AUTH_BACKENDS setting."
...
...
@@ -265,7 +265,7 @@ class SAMLProviderConfig(ProviderConfig):
prefix
=
'saml'
KEY_FIELDS
=
(
'idp_slug'
,
)
backend_name
=
models
.
CharField
(
max_length
=
50
,
default
=
'tpa-saml'
,
choices
=
[(
name
,
name
)
for
name
in
_PSA_SAML_BACKENDS
],
blank
=
False
,
max_length
=
50
,
default
=
'tpa-saml'
,
blank
=
False
,
help_text
=
"Which python-social-auth provider backend to use. 'tpa-saml' is the standard edX SAML backend."
)
idp_slug
=
models
.
SlugField
(
max_length
=
30
,
db_index
=
True
,
...
...
common/djangoapps/util/tests/test_db.py
View file @
b9b87f9b
...
...
@@ -4,13 +4,16 @@ import ddt
import
threading
import
time
import
unittest
from
unittest
import
skipIf
from
django.contrib.auth.models
import
User
from
django.core.management
import
call_command
from
django.conf
import
settings
from
django.db
import
connection
,
IntegrityError
from
django.db.transaction
import
atomic
,
TransactionManagementError
from
django.test
import
TestCase
,
TransactionTestCase
from
util.db
import
commit_on_success
,
generate_int_id
,
outer_atomic
from
util.db
import
commit_on_success
,
generate_int_id
,
outer_atomic
,
NoOpMigrationModules
@ddt.ddt
...
...
@@ -161,3 +164,17 @@ class GenerateIntIdTestCase(TestCase):
for
i
in
range
(
times
):
int_id
=
generate_int_id
(
minimum
,
maximum
,
used_ids
)
self
.
assertIn
(
int_id
,
list
(
set
(
range
(
minimum
,
maximum
+
1
))
-
used_ids
))
class
MigrationTests
(
TestCase
):
"""
Tests for migrations.
"""
@skipIf
(
isinstance
(
settings
.
MIGRATION_MODULES
,
NoOpMigrationModules
),
'Skip in case of NoOpMigrationModules'
)
def
test_migrations_are_in_sync
(
self
):
"""
Tests that the migration files are in sync with the models.
If this fails, you needs to run the Django command makemigrations.
"""
with
self
.
assertRaises
(
SystemExit
):
call_command
(
'makemigrations'
,
'-e'
)
lms/djangoapps/commerce/migrations/0003_auto_20160329_0709.py
0 → 100644
View file @
b9b87f9b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'commerce'
,
'0002_commerceconfiguration'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'commerceconfiguration'
,
options
=
{},
),
]
lms/djangoapps/lti_provider/migrations/0002_auto_20160325_0407.py
0 → 100644
View file @
b9b87f9b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
provider.utils
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'lti_provider'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'lticonsumer'
,
name
=
'consumer_secret'
,
field
=
models
.
CharField
(
default
=
provider
.
utils
.
short_token
,
unique
=
True
,
max_length
=
32
),
),
]
openedx/core/djangoapps/ccxcon/migrations/0002_auto_20160325_0407.py
0 → 100644
View file @
b9b87f9b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'ccxcon'
,
'0001_initial_ccxcon_model'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'ccxcon'
,
options
=
{
'verbose_name'
:
'CCX Connector'
,
'verbose_name_plural'
:
'CCX Connectors'
},
),
]
openedx/core/djangoapps/coursetalk/migrations/0002_auto_20160325_0631.py
0 → 100644
View file @
b9b87f9b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'coursetalk'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'coursetalkwidgetconfiguration'
,
name
=
'platform_key'
,
field
=
models
.
CharField
(
help_text
=
'The platform key associates CourseTalk widgets with your platform. Generally, it is the domain name for your platform. For example, if your platform is http://edx.org, the platform key is "edx".'
,
max_length
=
50
),
),
]
openedx/core/djangoapps/credentials/migrations/0002_auto_20160325_0631.py
0 → 100644
View file @
b9b87f9b
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'credentials'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'credentialsapiconfig'
,
options
=
{},
),
]
requirements/edx/base.txt
View file @
b9b87f9b
...
...
@@ -39,7 +39,7 @@ djangorestframework-oauth==1.1.0
edx-ccx-keys==0.1.2
edx-lint==0.4.3
edx-management-commands==0.0.1
edx-django-oauth2-provider==1.0.
1
edx-django-oauth2-provider==1.0.
2
edx-oauth2-provider==1.0.0
edx-opaque-keys==0.2.1
edx-organizations==0.4.0
...
...
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