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
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, April 9th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
58d62139
Commit
58d62139
authored
6 years ago
by
Matt Tuchfarber
Browse files
Options
Downloads
Patches
Plain Diff
quality
parent
7458cd88
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/discussion_api/views.py
+1
-1
1 addition, 1 deletion
lms/djangoapps/discussion_api/views.py
openedx/core/djangoapps/user_api/accounts/views.py
+17
-13
17 additions, 13 deletions
openedx/core/djangoapps/user_api/accounts/views.py
with
18 additions
and
14 deletions
lms/djangoapps/discussion_api/views.py
+
1
−
1
View file @
58d62139
...
...
@@ -627,7 +627,7 @@ class ReplaceUsernameView(APIView):
if
exc
.
status_code
==
404
:
return
Response
(
status
=
status
.
HTTP_404_NOT_FOUND
)
raise
except
Exception
as
exc
:
# pylint disable
-
broad-except
except
Exception
as
exc
:
# pylint
:
disable
=
broad-except
return
Response
(
text_type
(
exc
),
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
return
Response
(
status
=
status
.
HTTP_204_NO_CONTENT
)
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/user_api/accounts/views.py
+
17
−
13
View file @
58d62139
...
...
@@ -1145,21 +1145,25 @@ class UsernameReplacementView(APIView):
**
{
column
:
new_username
}
)
except
Exception
as
exc
:
# pylint: disable-broad-except
log
.
exception
(
"
Unable to change username from {current} to {new}. Reason: {error}
"
.
format
(
current
=
current_username
,
new
=
new_username
,
error
=
exc
))
log
.
exception
(
"
Unable to change username from %s to %s. Reason: %s
"
,
current_username
,
new_username
,
exc
)
return
False
if
num_rows_changed
==
0
:
log
.
warning
(
"
Unable to change username from {current} to {new} because {current} doesn
'
t exist.
"
.
format
(
current
=
current_username
,
new
=
new_username
,
))
log
.
warning
(
"
Unable to change username from %s to %s because %s doesn
'
t exist.
"
,
current_username
,
new_username
,
current_username
,
)
return
False
log
.
info
(
"
Successfully changed username from {current} to {new}.
"
.
format
(
current
=
current_username
,
new
=
new_username
,
))
log
.
info
(
"
Successfully changed username from %s to %s.
"
,
current_username
,
new_username
,
)
return
True
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