Created
April 8, 2020 17:23
-
-
Save Porter97/969a961a1a5027295b313037d58d66c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
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