Skip to content

Commit a2835c5

Browse files
committed
updates
1 parent bcc0ad7 commit a2835c5

7 files changed

Lines changed: 7 additions & 35 deletions

File tree

tkp_utils/sqla/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class User(Base):
1616

1717
_email = Column("email", String, nullable=False, unique=True)
1818

19-
apikeys = relationship('APIKey', back_populates='client')
19+
apikeys = relationship('APIKey', back_populates='user')
2020
admin = Column(Boolean, default=False)
2121

2222
@hybrid_property

tkp_utils/tests/test_handlers/test_base.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
from mock import MagicMock
44
from tornado.web import HTTPError
55

6-
CONTEXT = {'clients': {},
7-
'competitions': {},
8-
'leaderboards': {},
9-
'submissions': {},
10-
'stash': [],
11-
'all_clients': MagicMock(),
12-
'all_competitions': MagicMock(),
13-
'all_submissions': MagicMock(),
6+
CONTEXT = {'users': {},
147
'sessionmaker': MagicMock()}
158

169

tkp_utils/tests/test_handlers/test_html.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
from mock import MagicMock
66
from tornado.web import HTTPError
77

8-
context = {'clients': {},
9-
'competitions': {},
10-
'leaderboards': {},
11-
'submissions': {},
12-
'stash': [],
13-
'all_clients': MagicMock(),
14-
'all_competitions': MagicMock(),
15-
'all_submissions': MagicMock(),
8+
context = {'users': {},
169
'sessionmaker': MagicMock()}
1710

1811

tkp_utils/tests/test_handlers/test_login.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ def setup(self):
1919
def test_LoginHandler(self):
2020
req = MagicMock()
2121
req.body = ''
22-
context = {'clients': {1234: ''},
23-
'competitions': {},
24-
'leaderboards': {},
25-
'submissions': {},
26-
'stash': [],
27-
'all_clients': MagicMock(),
28-
'all_competitions': MagicMock(),
29-
'all_submissions': MagicMock(),
22+
context = {'users': {1234: ''},
3023
'sessionmaker': MagicMock()}
3124

3225
x = LoginHandler(self.app, req, **context)

tkp_utils/tests/test_handlers/test_logout.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ def setup(self):
1919
def test_LogoutHandler(self):
2020
req = MagicMock()
2121
req.body = ''
22-
context = {'clients': {1234: ''},
23-
'competitions': {},
24-
'leaderboards': {},
25-
'submissions': {},
26-
'stash': [],
27-
'all_clients': MagicMock(),
28-
'all_competitions': MagicMock(),
29-
'all_submissions': MagicMock(),
22+
context = {'users': {1234: ''},
3023
'sessionmaker': MagicMock()}
3124

3225
x = LogoutHandler(self.app, req, **context)

tkp_utils/tornado/handlers/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class LoginHandler(ServerHandler):
8-
def on_login(self, client):
8+
def on_login(self, user):
99
pass
1010

1111
@tornado.gen.coroutine

tkp_utils/tornado/handlers/register.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get(self):
2424
with self.session() as session:
2525
self.write(ujson.dumps(session.query(self.user_sql_class).all()))
2626
else:
27-
self._set_401("Unauthorized to view all clients")
27+
self._set_401("Unauthorized to view all users")
2828

2929
@tornado.gen.coroutine
3030
def post(self):

0 commit comments

Comments
 (0)