Skip to content

Commit

Permalink
Formatted with black
Browse files Browse the repository at this point in the history
  • Loading branch information
happycastle114 authored and github-actions[bot] committed Nov 6, 2023
1 parent 73f7244 commit af02368
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions scrap/utils/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ def save_to_database(record: ScrapResult):
updated_array = []
for councilor in record.councilors:
for before_councilor in result:
if councilor.name == before_councilor['name']:
before_councilor['party'] = councilor.party
if councilor.name == before_councilor["name"]:
before_councilor["party"] = councilor.party
updated_array.append(before_councilor)

collection.find_one_and_update(
{"councilId": record.council_id},
{"$set": {
"councilors" : updated_array
}}, upsert=True
{"$set": {"councilors": updated_array}},
upsert=True,
)
else:
return False

return True
except Exception as e:
print(e)
Expand Down

0 comments on commit af02368

Please sign in to comment.