Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
943ac409
Commit
943ac409
authored
7 years ago
by
Hasnain
Browse files
Options
Downloads
Patches
Plain Diff
Changing the service users for default clients.
parent
71028741
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py
+27
-0
27 additions, 0 deletions
...ng/management/commands/create_sites_and_configurations.py
with
27 additions
and
0 deletions
openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py
+
27
−
0
View file @
943ac409
...
...
@@ -117,6 +117,32 @@ class Command(BaseCommand):
checkout_on_ecommerce_service
=
True
)
def
_update_default_clients
(
self
):
"""
These two clients is being created by default without service
users so we have to associate the service users to them.
"""
ecommerce_queryset
=
Client
.
objects
.
filter
(
redirect_uri
=
"
https://ecommerce-{dns_name}.sandbox.edx.org/complete/edx-oidc/
"
.
format
(
dns_name
=
self
.
dns_name
)
)
if
ecommerce_queryset
:
ecommerce_client
=
ecommerce_queryset
[
0
]
ecommerce_client
.
user
=
self
.
ecommerce_user
ecommerce_client
.
save
()
discovery_queryset
=
Client
.
objects
.
filter
(
redirect_uri
=
"
https://discovery-{dns_name}.sandbox.edx.org/complete/edx-oidc/
"
.
format
(
dns_name
=
self
.
dns_name
)
)
if
discovery_queryset
:
discovery_client
=
discovery_queryset
[
0
]
discovery_client
.
user
=
self
.
discovery_user
discovery_client
.
save
()
def
_get_sites_data
(
self
):
"""
Reads the json files from theme directory and returns the site data in JSON format.
...
...
@@ -174,6 +200,7 @@ class Command(BaseCommand):
self
.
ecommerce_user
=
self
.
get_or_create_service_user
(
"
ecommerce_worker
"
)
all_sites
=
self
.
_get_sites_data
()
self
.
_update_default_clients
()
# creating Sites, SiteThemes, SiteConfigurations and oauth2 clients
for
site_name
,
site_data
in
all_sites
.
items
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment