Fix more formatting issues
This commit is contained in:
parent
8685c4a7a2
commit
a76c547fc4
1 changed files with 8 additions and 4 deletions
|
@ -83,7 +83,8 @@ def refresh_data(filename, fmt=None):
|
|||
datareader = csv.DictReader(csvfile)
|
||||
for row in datareader:
|
||||
rowcount += 1
|
||||
if row is None: continue
|
||||
if row is None:
|
||||
continue
|
||||
yield rowcount, rowcount / totalrows
|
||||
|
||||
# # Ensure any new data is flushed from time to time
|
||||
|
@ -149,17 +150,20 @@ def refresh_data(filename, fmt=None):
|
|||
ppl, source_id = get_by_id(row['Person'], Person, first=False)
|
||||
if not ppl or not ppl.first(): continue
|
||||
for person in ppl:
|
||||
for r in rzs: person.resources.append(r)
|
||||
for r in rzs:
|
||||
person.resources.append(r)
|
||||
person.save()
|
||||
count = count + 1
|
||||
|
||||
elif fmt['dataformat'] is DataFormat.PERSON_RANGE:
|
||||
rzs, source_id = get_by_id(row['MountainRange'], Range, first=False)
|
||||
if not rzs or not rzs.first(): continue
|
||||
if not rzs or not rzs.first():
|
||||
continue
|
||||
ppl, source_id = get_by_id(row['Person'], Person, first=False)
|
||||
if not ppl or not ppl.first(): continue
|
||||
for person in ppl:
|
||||
for r in rzs: person.ranges.append(r)
|
||||
for r in rzs:
|
||||
person.ranges.append(r)
|
||||
person.save()
|
||||
count = count + 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue