Skip to content

Commit

Permalink
[#3414] review clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Feb 9, 2017
1 parent 8541f22 commit bd03c7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
Expand Up @@ -2,5 +2,5 @@

{% block inner_primary_nav %}
{{ super() }}
{{ h.build_nav_icon('resource_data', _('DataPusher'), id=pkg.name, resource_id=res.id) }}
{{ h.build_nav_icon('resource_data', _('DataStore'), id=pkg.name, resource_id=res.id) }}
{% endblock %}
17 changes: 0 additions & 17 deletions ckanext/datastore/controller.py
Expand Up @@ -128,20 +128,3 @@ def dictionary(self, id, resource_id):
return render(
'datastore/dictionary.html',
extra_vars={'fields': fields})


def short_hash(field):
u'''
return a short hash (20 hex digits) of a json-compatible object.
We're using this to identify fields modified by the user when they
submit a form, and to detect if the source data changed before the
user submitted their changes. There's no need for a strong
cryptographic hash because this hash is only for preventing
accidental conflicts not enforcing access controls.
'''
return md5.md5(json.dumps(
field,
sort_keys=True,
ensure_ascii=False,
separators=(u',', u':').encode('utf-8'))).hexdigest()[:20]

0 comments on commit bd03c7b

Please sign in to comment.