Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Fix Draft Pill and wrong error label popping #29

Merged
merged 1 commit into from Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/entry_state.py
Expand Up @@ -75,7 +75,9 @@ def find_matching_resource(preview_resource, delivery_entry, search_field):
"""

for delivery_resource in delivery_entry.fields().get(search_field, []):
if preview_resource.id == delivery_resource.id:
if preview_resource.id == delivery_resource.id and (
delivery_resource.type == 'Entry' or delivery_resource.type == 'Asset'
):
return delivery_resource


Expand Down
12 changes: 7 additions & 5 deletions views/error.html
Expand Up @@ -43,15 +43,17 @@ <h2>{{ 'hintsLabel'|trans(current_locale.code) }}</h2>
{% endif %}
{% if environment != 'production' %}
{% if from_contentful %}
<h2>{{ 'errorLabel'|trans(current_locale.code) }}</h2>
<pre class='error__stack-trace'>
{% if 'message' in error.__dict__ %}
<h2>{{ 'errorLabel'|trans(current_locale.code) }}</h2>
<pre class='error__stack-trace'>
<code class='shell'>{{ error.message }}</code>
{% endif %}
{% if 'response' in error.__dict__ and 'json' in error.response.__dict__ %}
</pre>
{% elif 'response' in error.__dict__ and 'json' in error.response.__dict__ %}
<h2>{{ 'errorLabel'|trans(current_locale.code) }}</h2>
<pre class='error__stack-trace'>
<code class='shell'>{{ error.response.json()|pretty_json }}</code>
</pre>
{% endif %}
</pre>
{% endif %}
{% if stacktrace %}
<h2>{{ 'stackTraceLabel'|trans(current_locale.code) }}</h2>
Expand Down