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
8798ee0f
Commit
8798ee0f
authored
Jan 07, 2016
by
Ahsan Ulhaq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add credentials service user
parent
6e14461a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
cms/envs/test.py
+1
-0
lms/envs/common.py
+3
-0
lms/envs/test.py
+1
-0
openedx/core/djangoapps/credentials/migrations/0003_data__add_service_user.py
+34
-0
No files found.
cms/envs/test.py
View file @
8798ee0f
...
...
@@ -132,6 +132,7 @@ DATABASES = {
# This hack disables migrations during tests. We want to create tables directly from the models for speed.
# See https://groups.google.com/d/msg/django-developers/PWPj3etj3-U/kCl6pMsQYYoJ.
MIGRATION_MODULES
=
{
app
:
"app.migrations_not_used_in_tests"
for
app
in
INSTALLED_APPS
}
MIGRATION_MODULES
[
"credentials"
]
=
"app.migrations_not_used_in_tests"
LMS_BASE
=
"localhost:8000"
FEATURES
[
'PREVIEW_LMS_BASE'
]
=
"preview"
...
...
lms/envs/common.py
View file @
8798ee0f
...
...
@@ -2553,6 +2553,9 @@ ECOMMERCE_API_SIGNING_KEY = None
ECOMMERCE_API_TIMEOUT
=
5
ECOMMERCE_SERVICE_WORKER_USERNAME
=
'ecommerce_worker'
# Credentials configuration
CREDENTIALS_SERVICE_USERNAME
=
'credentials_service_user'
# Reverification checkpoint name pattern
CHECKPOINT_PATTERN
=
r'(?P<checkpoint_name>[^/]+)'
...
...
lms/envs/test.py
View file @
8798ee0f
...
...
@@ -190,6 +190,7 @@ DATABASES = {
# This hack disables migrations during tests. We want to create tables directly from the models for speed.
# See https://groups.google.com/d/msg/django-developers/PWPj3etj3-U/kCl6pMsQYYoJ.
MIGRATION_MODULES
=
{
app
:
"app.migrations_not_used_in_tests"
for
app
in
INSTALLED_APPS
}
MIGRATION_MODULES
[
"credentials"
]
=
"app.migrations_not_used_in_tests"
CACHES
=
{
# This is the cache used for most things.
...
...
openedx/core/djangoapps/credentials/migrations/0003_data__add_service_user.py
0 → 100644
View file @
8798ee0f
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
def
add_service_user
(
apps
,
schema_editor
):
"""Add service user."""
user
,
created
=
User
.
objects
.
get_or_create
(
username
=
settings
.
CREDENTIALS_SERVICE_USERNAME
,
is_staff
=
True
)
if
created
:
user
.
set_unusable_password
()
user
.
save
()
def
remove_service_user
(
apps
,
schema_editor
):
"""Remove service user."""
try
:
User
.
objects
.
get
(
username
=
settings
.
CREDENTIALS_SERVICE_USERNAME
)
.
delete
()
except
User
.
DoesNotExist
:
return
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'credentials'
,
'0002_credentialsapiconfig_cache_ttl'
),
]
operations
=
[
migrations
.
RunPython
(
add_service_user
,
remove_service_user
),
]
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