Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
5f3bfd1a
Commit
5f3bfd1a
authored
6 years ago
by
Matt Tuchfarber
Browse files
Options
Downloads
Patches
Plain Diff
Fix documentation and logging
parent
41a5ebb0
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/user_api/accounts/permissions.py
+1
-2
1 addition, 2 deletions
openedx/core/djangoapps/user_api/accounts/permissions.py
openedx/core/djangoapps/user_api/accounts/views.py
+2
-1
2 additions, 1 deletion
openedx/core/djangoapps/user_api/accounts/views.py
with
3 additions
and
3 deletions
openedx/core/djangoapps/user_api/accounts/permissions.py
+
1
−
2
View file @
5f3bfd1a
...
...
@@ -28,8 +28,7 @@ class CanRetireUser(permissions.BasePermission):
class
CanReplaceUsername
(
permissions
.
BasePermission
):
"""
Grants access to the Username Replacement API for anyone in the group,
including the service user.
Grants access to the Username Replacement API for the service user.
"""
def
has_permission
(
self
,
request
,
view
):
return
request
.
user
.
username
==
getattr
(
settings
,
"
USERNAME_REPLACEMENT_WORKER
"
,
False
)
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/user_api/accounts/views.py
+
2
−
1
View file @
5f3bfd1a
...
...
@@ -1148,9 +1148,10 @@ class UsernameReplacementView(APIView):
)
except
Exception
as
exc
:
# pylint: disable=broad-except
log
.
exception
(
u
"
Unable to change username from %s to %s.
Reason:
%s
"
,
u
"
Unable to change username from %s to %s.
Failed on table %s because
%s
"
,
current_username
,
new_username
,
model
.
__class__
.
__name__
,
# Retrieves the model name that it failed on
exc
)
return
False
...
...
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