Skip to content

Commit

Permalink
Merge 34a879b into 5e4279d
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Oct 28, 2020
2 parents 5e4279d + 34a879b commit 67fefa5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 40 deletions.
32 changes: 13 additions & 19 deletions cove_360/templates/cove_360/validation_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,20 @@
{% for error_json, error_extra in validation_errors %}
{% with error=error_json|json_decode %}
<tr>
{% if error.message_safe %}
<td>
<p>
<strong>{{ error.message_safe | safe }}</strong>
{% if error.message_type in common_error_types %}
<a href="{% url 'common_errors' %}#{{error.message_type}}" target="_blank">(more info)</a>
{% endif %}
</p>
{% if 'schema_title' in error %}
<div class="well well-sm">
<h4>{{ error.schema_title }}</h4>
<p>{{ error.schema_description_safe | safe }}</p>
</div>
<td>
<p>
<strong>{{ error | html_error_msg }}</strong>
{% if error.message_type in common_error_types %}
<a href="{% url 'common_errors' %}#{{error.message_type}}" target="_blank">(more info)</a>
{% endif %}
</td>
{% elif error.message_type in common_error_types %}
<td><a href="{% url 'common_errors' %}#{{error.message_type}}"> {{error.message}} </a></td>
{% else %}
<td>{{error.message}}</td>
{% endif %}
</p>
{% if 'schema_title' in error %}
<div class="well well-sm">
<h4>{{ error.schema_title }}</h4>
<p>{{ error.schema_description_safe | safe }}</p>
</div>
{% endif %}
</td>
<td class="text-center">
{% if error_extra.values|length > 3 %}
{% if error_prefix %}
Expand Down
3 changes: 1 addition & 2 deletions cove_360/tests_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ def test_common_index_elements(server_url, browser):
assert 'Why do you delete data after seven days?' in browser.find_element_by_tag_name('body').text
assert 'Why provide converted versions?' in browser.find_element_by_tag_name('body').text
assert 'Terms & Conditions' in browser.find_element_by_tag_name('body').text
assert 'Open Data Services' in browser.find_element_by_tag_name('body').text
assert 'Open Data Services Co-operative' not in browser.find_element_by_tag_name('body').text
assert 'Open Data Services Co-operative' in browser.find_element_by_tag_name('body').text
assert '360 Giving' not in browser.find_element_by_tag_name('body').text


Expand Down
13 changes: 1 addition & 12 deletions cove_360/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import codecs
import csv
import functools
import itertools
import json
import logging
from decimal import Decimal

from cove.views import explore_data_context
from cove.views import explore_data_context, cove_web_input_error
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
Expand All @@ -23,16 +22,6 @@
logger = logging.getLogger(__name__)


def cove_web_input_error(func):
@functools.wraps(func)
def wrapper(request, *args, **kwargs):
try:
return func(request, *args, **kwargs)
except CoveInputDataError as err:
return render(request, 'error.html', context=err.context)
return wrapper


@cove_web_input_error
def explore_360(request, pk, template='cove_360/explore.html'):
schema_360 = Schema360()
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Django>2.2<2.3
#^^ rq.filter: <1.12
flattentool>=0.11.0
libcove>=0.18.0
-e git+https://github.com/OpenDataServices/lib-cove-web.git@v0.14.0#egg=libcoveweb
libcove>=0.20.1
libcoveweb>=0.18.1
django-bootstrap3
django-debug-toolbar
requests
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==2.2.15 # rq.filter: <1.12
flattentool==0.11.0
libcove==0.18.0
-e git+https://github.com/OpenDataServices/lib-cove-web.git@73654b76161dabe1d406cd28f8aca7fd94dceafb#egg=libcoveweb
libcove==0.20.1
libcoveweb==0.18.1
django-bootstrap3==12.1.0
django-debug-toolbar==2.2
requests==2.24.0
Expand Down
4 changes: 2 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==2.2.15 # rq.filter: <1.12
flattentool==0.11.0
libcove==0.18.0
-e git+https://github.com/OpenDataServices/lib-cove-web.git@73654b76161dabe1d406cd28f8aca7fd94dceafb#egg=libcoveweb
libcove==0.20.1
libcoveweb==0.18.1
django-bootstrap3==12.1.0
django-debug-toolbar==2.2
requests==2.24.0
Expand Down
2 changes: 1 addition & 1 deletion update_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Delete and recreate a virtualenv to ensure that we don't have any extra
# packages installed in it
rm -rf .ve
python3 -m venv .ve
python3.5 -m venv .ve
source .ve/bin/activate

if [[ "$1" == "--new-only" ]]; then
Expand Down

0 comments on commit 67fefa5

Please sign in to comment.