Commit e5af629f authored by Kroustouris Stauros's avatar Kroustouris Stauros

Merge branch 'master' of https://github.com/grnet/djnro

parents e8170c43 362e63a8
...@@ -44,9 +44,9 @@ class Command(BaseCommand): ...@@ -44,9 +44,9 @@ class Command(BaseCommand):
else: else:
write = lambda *args: None write = lambda *args: None
self.parse_and_create(args[0]) self.parse_and_create(args[0], write)
def parse_and_create(self, instxmlfile): def parse_and_create(self, instxmlfile, write):
doc = ElementTree.parse(instxmlfile) doc = ElementTree.parse(instxmlfile)
realmid = Realm.objects.get(pk=1) realmid = Realm.objects.get(pk=1)
root = doc.getroot() root = doc.getroot()
...@@ -122,7 +122,7 @@ class Command(BaseCommand): ...@@ -122,7 +122,7 @@ class Command(BaseCommand):
address_city=city, address_city=city,
number_id=1 number_id=1
) )
print instcontactslist write('Institution contact list: %s\n' % instcontactslist)
instdets_obj.save() instdets_obj.save()
instdets_obj.contact = instcontactslist instdets_obj.contact = instcontactslist
instdets_obj.save() instdets_obj.save()
...@@ -246,6 +246,6 @@ class Command(BaseCommand): ...@@ -246,6 +246,6 @@ class Command(BaseCommand):
) )
t.save() t.save()
except Exception as e: except Exception as e:
write('ERROR: %s\n' % e) self.stderr.write('ERROR: %s\n' % e)
continue continue
return True return True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment