This commit is contained in:
PCoder 2022-03-05 01:01:28 +05:30
parent a0c3dd57dd
commit 27ecafa887

View file

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