Skip to content

Commit

Permalink
Merge db4458a into 46966b8
Browse files Browse the repository at this point in the history
  • Loading branch information
macintoshpie committed Apr 3, 2020
2 parents 46966b8 + db4458a commit e3004f9
Show file tree
Hide file tree
Showing 30 changed files with 39,603 additions and 1,016 deletions.
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ xmltodict==0.11.0
requests==2.20.0
lxml==4.2.5
probablepeople==0.5.4
xmlschema==1.1.1
# Parsing and managing geojson data (this is only used in managed tasks at the moment)
geojson==2.4.1

Expand Down
8 changes: 5 additions & 3 deletions seed/api/v2_1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ def building_sync(self, request, pk):
# Check if there is an existing BuildingSync XML file to merge
bs_file = property_view.state.building_files.last()
if bs_file is not None and os.path.exists(bs_file.file.path):
bs.import_file(bs_file.file.path)
xml = bs.export(property_view.state, BuildingSync.BRICR_STRUCT)
# TODO: once all 2.0-pr1 files are converted to 2.0, remove require_version
# arg or set to True to ensure all files exported are of a known version
bs.import_file(bs_file.file.path, require_version=False)
xml = bs.export(property_view.state)
return HttpResponse(xml, content_type='application/xml')
else:
# create a new XML from the record, do not import existing XML
xml = bs.export(property_view.state, BuildingSync.BRICR_STRUCT)
xml = bs.export(property_view.state)
return HttpResponse(xml, content_type='application/xml')

@detail_route(methods=['GET'])
Expand Down
976 changes: 267 additions & 709 deletions seed/building_sync/building_sync.py

Large diffs are not rendered by default.

0 comments on commit e3004f9

Please sign in to comment.