This commit is contained in:
PCoder 2022-03-05 01:01:28 +05:30
parent a0c3dd57dd
commit 27ecafa887
1 changed files with 2 additions and 0 deletions

View File

@ -106,8 +106,10 @@ def refresh_data(filename, fmt=None, update_existing=False):
person, source_id = get_by_id(row['ID'], Person)
if not person:
person = Person.objects.filter(first_name=row['First name'], last_name=row['Last name']).first()
print("Fetched from DB")
if not person:
person = Person(first_name=row['First name'], last_name=row['Last name'], source_id=row['ID'])
print("Created")
# Update data fields
if update_existing: