Rename gravatar field after the bees merge.
This commit is contained in:
parent
1c32faa31d
commit
b3240de1f8
1 changed files with 8 additions and 8 deletions
|
@ -152,7 +152,7 @@ class User(ApiResource):
|
||||||
'id': 'UserView',
|
'id': 'UserView',
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'description': 'Describes a user',
|
'description': 'Describes a user',
|
||||||
'required': ['verified', 'anonymous', 'gravatar'],
|
'required': ['verified', 'anonymous', 'avatar'],
|
||||||
'properties': {
|
'properties': {
|
||||||
'verified': {
|
'verified': {
|
||||||
'type': 'boolean',
|
'type': 'boolean',
|
||||||
|
@ -166,9 +166,9 @@ class User(ApiResource):
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'description': 'The user\'s email address',
|
'description': 'The user\'s email address',
|
||||||
},
|
},
|
||||||
'gravatar': {
|
'avatar': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'description': 'Gravatar hash representing the user\'s icon'
|
'description': 'Avatar hash representing the user\'s icon'
|
||||||
},
|
},
|
||||||
'organizations': {
|
'organizations': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
|
@ -212,7 +212,7 @@ class User(ApiResource):
|
||||||
user = get_authenticated_user()
|
user = get_authenticated_user()
|
||||||
user_data = request.get_json()
|
user_data = request.get_json()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if 'password' in user_data:
|
if 'password' in user_data:
|
||||||
logger.debug('Changing password for user: %s', user.username)
|
logger.debug('Changing password for user: %s', user.username)
|
||||||
log_action('account_change_password', user.username)
|
log_action('account_change_password', user.username)
|
||||||
|
@ -230,8 +230,8 @@ class User(ApiResource):
|
||||||
if model.find_user_by_email(new_email):
|
if model.find_user_by_email(new_email):
|
||||||
# Email already used.
|
# Email already used.
|
||||||
raise request_error(message='E-mail address already used')
|
raise request_error(message='E-mail address already used')
|
||||||
|
|
||||||
if features.MAILING:
|
if features.MAILING:
|
||||||
logger.debug('Sending email to change email address for user: %s',
|
logger.debug('Sending email to change email address for user: %s',
|
||||||
user.username)
|
user.username)
|
||||||
code = model.create_confirm_email_code(user, new_email=new_email)
|
code = model.create_confirm_email_code(user, new_email=new_email)
|
||||||
|
@ -247,7 +247,7 @@ class User(ApiResource):
|
||||||
raise request_error(message='Username is already in use')
|
raise request_error(message='Username is already in use')
|
||||||
|
|
||||||
model.change_username(user, new_username)
|
model.change_username(user, new_username)
|
||||||
|
|
||||||
except model.InvalidPasswordException, ex:
|
except model.InvalidPasswordException, ex:
|
||||||
raise request_error(exception=ex)
|
raise request_error(exception=ex)
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ class PrivateRepositories(ApiResource):
|
||||||
plan = get_plan(cus.subscription.plan.id)
|
plan = get_plan(cus.subscription.plan.id)
|
||||||
if plan:
|
if plan:
|
||||||
repos_allowed = plan['privateRepos']
|
repos_allowed = plan['privateRepos']
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'privateCount': private_repos,
|
'privateCount': private_repos,
|
||||||
'privateAllowed': (private_repos < repos_allowed)
|
'privateAllowed': (private_repos < repos_allowed)
|
||||||
|
|
Reference in a new issue