Skip to content

Developer rename bug fix #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions appstore/dev_portal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ def update_my_developer():
me = result.json()
developer_id = me["id"]

developer = Developer.query.filter_by(id=developer_id).one()
print("Update developer from " + developer.name + " to " + req["name"])
developer.name = req["name"]
db.session.commit()

return jsonify(success=True, id=developer.id, name=developer.name)
developer = Developer.query.filter_by(id=developer_id).one_or_none()
if developer is not None:
print("Update developer from " + developer.name + " to " + req["name"])
developer.name = req["name"]
db.session.commit()
return jsonify(success=True, id=developer.id, name=developer.name)
else
return jsonify(success=False, error="You do not have a developer ID to rename. Set up your account first.", e="account.nonexistant"), 400


@legacy_api.route('/applications/<app_id>/add_heart', methods=['POST'])
Expand Down