Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
djnro
Commits
362e63a8
Commit
362e63a8
authored
Nov 10, 2015
by
Zenon Mousmoulas
Browse files
Merge pull request #6 from REANNZ/master
A few fixes for parse_institution_xml management command
parents
53a92424
55e772bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
edumanage/management/commands/parse_institution_xml.py
View file @
362e63a8
...
...
@@ -44,9 +44,9 @@ class Command(BaseCommand):
else
:
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
)
realmid
=
Realm
.
objects
.
get
(
pk
=
1
)
root
=
doc
.
getroot
()
...
...
@@ -122,7 +122,7 @@ class Command(BaseCommand):
address_city
=
city
,
number_id
=
1
)
p
ri
n
t
instcontactslist
w
rit
e
(
'Institution contact list: %s
\n
'
%
instcontactslist
)
instdets_obj
.
save
()
instdets_obj
.
contact
=
instcontactslist
instdets_obj
.
save
()
...
...
@@ -246,6 +246,6 @@ class Command(BaseCommand):
)
t
.
save
()
except
Exception
as
e
:
write
(
'ERROR: %s
\n
'
%
e
)
self
.
stderr
.
write
(
'ERROR: %s
\n
'
%
e
)
continue
return
True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment