Skip to content
Snippets Groups Projects
Commit 6fd4eef8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

null check simplified

parent d1999e2f
No related branches found
No related tags found
1 merge request!275Resolve "update automatic visit/subject importer"
......@@ -50,9 +50,8 @@ class Importer(EtlCommon):
logging.getLogger('').removeHandler(warning_counter)
def import_study_subject(self, study_subject: StudySubject):
db_study_subjects = StudySubject.objects.filter(nd_number=study_subject.nd_number)
if db_study_subjects.count() > 0:
db_study_subject = db_study_subjects.first()
db_study_subject = StudySubject.objects.filter(nd_number=study_subject.nd_number).first()
if db_study_subject is not None:
for field in Subject._meta.get_fields():
if field.get_internal_type() == "CharField" or \
field.get_internal_type() == "DateField" or \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment