Skip to content

Commit

Permalink
Fix missing package in Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
bfbachmann committed Jul 21, 2018
1 parent aea1416 commit 23cea59
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 25 deletions.
5 changes: 0 additions & 5 deletions bounce/db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ def select(session, username):
Returns the user with the given username or None if
there is no such user.
"""
<<<<<<< HEAD
return session.query(User).filter(User.username == username).first()
=======
user = session.query(User).filter(User.username == username).first()
return None if user is None else user
>>>>>>> Add user authentication


def insert(session, full_name, username, secret, email):
Expand Down
8 changes: 0 additions & 8 deletions bounce/server/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@
from . import APIError, Endpoint, util
from ...db import user
from ..resource import validate
<<<<<<< HEAD
from ..resource.auth import AuthenticateUserRequest, AuthenticateUserResponse
=======
from ..resource.auth import AuthenticateUserRequeset, AuthenticateUserResponse
>>>>>>> Add user authentication


class LoginEndpoint(Endpoint):
"""Handles requests to /auth/login."""

__uri__ = '/auth/login'

<<<<<<< HEAD
@validate(AuthenticateUserRequest, AuthenticateUserResponse)
=======
@validate(AuthenticateUserRequeset, AuthenticateUserResponse)
>>>>>>> Add user authentication
async def post(self, request):
"""Handles a POST /auth/login request by validating the user's
credentials and issuing them a JSON Web Token."""
Expand Down
8 changes: 0 additions & 8 deletions bounce/server/api/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ async def put(self, request, username, id_from_token=None):
# Make sure the ID from the token is for the user we're updating
user_row = user.select(self.server.db_session, username)
if not user_row:
<<<<<<< HEAD
raise APIError('No such user', status=404)
=======
raise APIError('No such user', status=400)
>>>>>>> Add user authentication
if user_row.identifier != id_from_token:
raise APIError('Forbidden', status=403)
# Update the user
Expand All @@ -57,11 +53,7 @@ async def delete(self, _, username, id_from_token=None):
# Make sure the ID from the token is for the user we're deleting
user_row = user.select(self.server.db_session, username)
if not user_row:
<<<<<<< HEAD
raise APIError('No such user', status=404)
=======
raise APIError('No such user', status=400)
>>>>>>> Add user authentication
elif user_row.identifier != id_from_token:
raise APIError('Forbidden', status=403)
# Delete the user
Expand Down
2 changes: 1 addition & 1 deletion bounce/server/api/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime, timedelta

import bcrypt
from jose import jwt, exceptions
from jose import exceptions, jwt

# Regexes for validating passwords and usernames
# pylint: disable=anomalous-backslash-in-string
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ flake8==3.5.0
yapf==0.22.0
isort==4.3.4
pytest-asyncio==0.8.0
aiohttp==3.3.0
aiohttp==3.3.2
idna-ssl==1.1.0
coveralls==1.3.0
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile --output-file test-requirements.txt test-requirements.in
#
aiohttp==3.3.0
aiohttp==3.3.2
astroid==1.6.5 # via pylint
async-timeout==3.0.0 # via aiohttp
atomicwrites==1.1.5 # via pytest
Expand All @@ -15,7 +15,7 @@ coverage==4.5.1 # via coveralls
coveralls==1.3.0
docopt==0.6.2 # via coveralls
flake8==3.5.0
idna-ssl==1.1.0 # via aiohttp
idna-ssl==1.1.0
idna==2.7 # via idna-ssl, requests, yarl
isort==4.3.4
lazy-object-proxy==1.3.1 # via astroid
Expand Down

0 comments on commit 23cea59

Please sign in to comment.