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
84d91a79
Commit
84d91a79
authored
Mar 03, 2015
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly point to MAX_LENGTH instead of MIN_LENGTH.
Bug introduced in recent commit.
parent
ff72eada
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
openedx/core/djangoapps/user_api/api/profile.py
+5
-0
openedx/core/djangoapps/user_api/tests/test_views.py
+2
-3
openedx/core/djangoapps/user_api/views.py
+1
-3
No files found.
openedx/core/djangoapps/user_api/api/profile.py
View file @
84d91a79
...
...
@@ -14,6 +14,7 @@ from pytz import UTC
import
analytics
from
eventtracking
import
tracker
from
..accounts
import
NAME_MIN_LENGTH
from
..accounts.views
import
AccountView
from
..models
import
User
,
UserPreference
,
UserOrgTag
from
..helpers
import
intercept_errors
...
...
@@ -36,6 +37,10 @@ class ProfileInternalError(Exception):
pass
FULL_NAME_MAX_LENGTH
=
255
FULL_NAME_MIN_LENGTH
=
NAME_MIN_LENGTH
@intercept_errors
(
ProfileInternalError
,
ignore_errors
=
[
ProfileRequestError
])
def
preference_info
(
username
):
"""Retrieve information about a user's preferences.
...
...
openedx/core/djangoapps/user_api/tests/test_views.py
View file @
84d91a79
...
...
@@ -28,7 +28,6 @@ from ..api import account as account_api, profile as profile_api
from
..models
import
UserOrgTag
from
..tests.factories
import
UserPreferenceFactory
from
..tests.test_constants
import
SORTED_COUNTRIES
from
openedx.core.djangoapps.user_api.accounts
import
NAME_MIN_LENGTH
TEST_API_KEY
=
"test_api_key"
...
...
@@ -842,7 +841,7 @@ class RegistrationViewTest(ApiTestCase):
u"label"
:
u"Full name"
,
u"instructions"
:
u"The name that will appear on your certificates"
,
u"restrictions"
:
{
"max_length"
:
NAME_MIN
_LENGTH
,
"max_length"
:
profile_api
.
FULL_NAME_MAX
_LENGTH
,
},
}
)
...
...
@@ -922,7 +921,7 @@ class RegistrationViewTest(ApiTestCase):
u"label"
:
u"Full name"
,
u"instructions"
:
u"The name that will appear on your certificates"
,
u"restrictions"
:
{
"max_length"
:
NAME_MIN_LENGTH
"max_length"
:
profile_api
.
FULL_NAME_MAX_LENGTH
,
}
}
)
...
...
openedx/core/djangoapps/user_api/views.py
View file @
84d91a79
...
...
@@ -33,8 +33,6 @@ from .helpers import FormDescription, shim_student_view, require_post_params
from
.models
import
UserPreference
,
UserProfile
from
.serializers
import
UserSerializer
,
UserPreferenceSerializer
from
openedx.core.djangoapps.user_api.accounts
import
NAME_MIN_LENGTH
class
LoginSessionView
(
APIView
):
"""HTTP end-points for logging in users. """
...
...
@@ -352,7 +350,7 @@ class RegistrationView(APIView):
label
=
name_label
,
instructions
=
name_instructions
,
restrictions
=
{
"max_length"
:
NAME_MIN
_LENGTH
,
"max_length"
:
profile_api
.
FULL_NAME_MAX
_LENGTH
,
},
required
=
required
)
...
...
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