Skip to content

Commit

Permalink
Fix edge case so that metadata language maps are ordered, even if `…
Browse files Browse the repository at this point in the history
…extension.json` didn't have language maps
  • Loading branch information
James McKinney committed Nov 3, 2018
1 parent 449a08e commit e0709de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.0.6

* Fix edge case so that `metadata` language maps are ordered, even if `extension.json` didn't have language maps.

## 0.0.5 (2018-10-31)

* Add `ProfileBuilder`, `Codelist`, `CodelistCode` classes.
Expand Down
3 changes: 2 additions & 1 deletion ocdsextensionregistry/extension_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import csv
import os.path
import re
from collections import OrderedDict
from contextlib import closing
from io import BytesIO, StringIO
from urllib.parse import urlparse
Expand Down Expand Up @@ -101,7 +102,7 @@ def metadata(self):
self._metadata[field] = {}
# Add language maps.
if not isinstance(self._metadata[field], dict):
self._metadata[field] = {'en': self._metadata[field]}
self._metadata[field] = OrderedDict({'en': self._metadata[field]})

if 'compatibility' not in self._metadata or isinstance(self._metadata['compatibility'], str):
self._metadata['compatibility'] = ['1.1']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='ocdsextensionregistry',
version='0.0.5',
version='0.0.6',
author='Open Contracting Partnership',
author_email='data@open-contracting.org',
url='https://github.com/open-contracting/extension_registry.py',
Expand Down

0 comments on commit e0709de

Please sign in to comment.