def get_user_profile(account_id): user = jira_client.get_user(account_id) user_profile = User() user_profile.accountId = user['accountId'] user_profile.avatarUrl = user['avatarUrls']['48x48'] user_profile.userName = user['displayName'] return jsonify(user_profile.__dict__), 200
def sign_in(): json_data = request.json jira_user = json_data['jiraUser'] jira_token = json_data['jiraToken'] jira_client_of_user = JIRA(JIRA_URL, basic_auth=(jira_user, jira_token)) user_profile = jira_client_of_user.get_myself_user_profile() user = User() user.accountId = user_profile['accountId'] user.userName = user_profile['key'] user.avatarUrl = user_profile['avatarUrls']['48x48'] return jsonify(user.__dict__)