Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created April 8, 2020 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/969a961a1a5027295b313037d58d66c4 to your computer and use it in GitHub Desktop.
Save Porter97/969a961a1a5027295b313037d58d66c4 to your computer and use it in GitHub Desktop.
#...
from .errors import page_not_found
from ..models import User
#...
@main.route('/user/<username>', methods=['GET'])
@login_required
def get_user(username):
user = User.query.filter_by(username=username).first()
if not user:
return page_not_found
user = user.to_json()
user.pop('stream_token')
user.pop('email')
return {'profile': user}
#...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment