зависимости

feature/fix_generate_pass
Andrey 8 years ago
parent 057dc2b1aa
commit ea3630accd
  1. 24
      csv/load_perm.py

@ -51,19 +51,13 @@ if __name__ == '__main__':
pivots = json.loads(row['success']) pivots = json.loads(row['success'])
for pivot in pivots: for pivot in pivots:
try: pv = ProgressLesson.objects.create(
pv = ProgressLesson.objects.create( progress=p,
progress=p, lesson_token=find_id(pivot['id']),
lesson_token=find_id(pivot['id']), teacher=get_user_model().objects.get(email=pivot['teacher']),
teacher=get_user_model().objects.get(email=pivot['teacher']), )
)
if pivot['date'] and not pivot['date'] == 'None':
pv.date = datetime.strptime(pivot['date'].split('.')[0], '%Y-%m-%d %H:%M:%S')
pv.status = 2
pv.save()
except Lesson.DoesNotExist:
pass
if pivot['date'] and not pivot['date'] == 'None':
pv.date = datetime.strptime(pivot['date'].split('.')[0], '%Y-%m-%d %H:%M:%S')
pv.status = 2
pv.save()

Loading…
Cancel
Save