login-dev endpoint accepts role query arg

This commit is contained in:
dandds 2018-07-17 13:56:36 -04:00
parent 7d3cd04bdd
commit f573181154
2 changed files with 17 additions and 6 deletions

View File

@ -2,8 +2,22 @@ import tornado.gen
from atst.handler import BaseHandler from atst.handler import BaseHandler
_DEV_USERS = {
"ccpo": {
"id": "164497f6-c1ea-4f42-a5ef-101da278c012",
"first_name": "Sam",
"last_name": "CCPO",
},
"owner": {
"id": "cce17030-4109-4719-b958-ed109dbb87c8",
"first_name": "Olivia",
"last_name": "Owner",
},
}
class Dev(BaseHandler): class Dev(BaseHandler):
def initialize(self, action, sessions, authz_client): def initialize(self, action, sessions, authz_client):
self.action = action self.action = action
self.sessions = sessions self.sessions = sessions
@ -11,9 +25,6 @@ class Dev(BaseHandler):
@tornado.gen.coroutine @tornado.gen.coroutine
def get(self): def get(self):
user = { role = self.get_argument("role", "ccpo")
"id": "164497f6-c1ea-4f42-a5ef-101da278c012", user = _DEV_USERS[role]
"first_name": "Test",
"last_name": "User",
}
yield self.login(user) yield self.login(user)

View File

@ -5,7 +5,7 @@
</a> </a>
<a href="/" class="topbar__link topbar__link--secondary"> <a href="/" class="topbar__link topbar__link--secondary">
<span>Tech Lead</span> <span>{{ current_user["atat_role"] }}</span>
</a> </a>
</nav> </nav>
</header> </header>