Skip to content

Commit

Permalink
Merge pull request #51 from Code4GovTech/fix/multi-repo
Browse files Browse the repository at this point in the history
Fix/multi repo
  • Loading branch information
jaanbaaz authored Aug 21, 2024
2 parents 2bdfa5c + 04788cb commit e0c9c3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DMP-CMS-Backend-API
2 changes: 1 addition & 1 deletion query.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_issue_owner(name):
return response

def get_actual_owner_query(owner):
results = DmpOrg.query.filter(DmpOrg.name.like(f'%{owner}%')).all()
results = DmpIssue.query.filter(DmpIssue.repo_owner.like(f'%{owner}%')).all()
results = [val.to_dict() for val in results]
return results

Expand Down
1 change: 1 addition & 0 deletions v2_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def get_issues_by_owner_id_v2(owner, issue):

url = f"https://github.com/{owner}"

# import pdb;pdb.set_trace()
actual_owner = PostgresORM.get_actual_owner_query(owner)
repo_owner =actual_owner[0]['repo_owner'] if actual_owner else ""
#create url with repo owner
Expand Down

0 comments on commit e0c9c3e

Please sign in to comment.