Skip to content

Commit

Permalink
Merge pull request #18 from Code4GovTech/sasi_dev_v2
Browse files Browse the repository at this point in the history
v2 api changes in week leanrings html
  • Loading branch information
sasi2312 authored Jun 18, 2024
2 parents 1bf2424 + 34658d5 commit 67df7df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion v2_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def get_issues_by_owner_id_v2(owner, issue):
if not cont_details:
cont_details = dmp_issue_id['contributor_username']
week_data = week_data_formatter(plain_text_body,"Goals")

res = {
"name": dmp_issue_id['title'],
"description": dmp_issue_id['description'],
Expand Down
3 changes: 3 additions & 0 deletions v2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def week_data_formatter(html_content, type):
weekly_updates = []

if type == "Learnings":
# tasks_per_week = re.split(r'<h3>Week \d+</h3>', html_content)[1:]
tasks_per_week = re.split(r'(<.*?>Week \d+<.*?>)', html_content)[1:]
tasks_per_week = [tasks_per_week[i] for i in range(1, len(tasks_per_week), 2)]
for i, week in enumerate(week_matches):
task_list_html = tasks_per_week[i] if i < len(tasks_per_week) else ""
weekly_updates.append({
Expand Down

0 comments on commit 67df7df

Please sign in to comment.