diff --git a/v2_app.py b/v2_app.py index ed0667f..c9a4025 100644 --- a/v2_app.py +++ b/v2_app.py @@ -15,8 +15,16 @@ def get_issues_by_owner_id_v2(owner, issue): try: SUPABASE_DB = SupabaseInterface().get_instance() # Fetch issue updates based on owner and issue number + + url = f"https://github.com/{owner}" + + # import pdb;pdb.set_trace() + actual_owner = SUPABASE_DB.client.table('dmp_orgs').select('id','name','repo_owner').like('name',owner).execute().data + repo_owner =actual_owner[0]['repo_owner'] if actual_owner else "" + #create url with repo owner + url = f"https://github.com/{repo_owner}" if repo_owner else None + - url = f"https://github.com/{owner}" dmp_issue_id = SUPABASE_DB.client.table('dmp_issues').select('*').like('issue_url', f'%{url}%').eq('issue_number', issue).execute() if not dmp_issue_id.data: return jsonify({'error': "No data found"}), 500 diff --git a/v2_utils.py b/v2_utils.py index 8cd48b0..5697aa6 100644 --- a/v2_utils.py +++ b/v2_utils.py @@ -7,9 +7,12 @@ def define_link_data(usernames): if type(usernames) == list: for username in usernames: val = {} + if username[0]=="@": + username = username[1:] val['name'] = username val['link'] = "https://github.com/" + username res.append(val) + if type(usernames) == str: if usernames[0]=="@": usernames = usernames[1:]