okfn / website

The code behind okfn.org
https://okfn.org
MIT License
108 stars 107 forks source link

Error 500 searching #1090

Open avdata99 opened 5 months ago

avdata99 commented 5 months ago

URL: https://okfn.org/en/search/?q=common

image

Logs

Exception Type: NoReverseMatch at /en/search/
    raise NoReverseMatch(msg)
Raised during: haystack.views.SearchView
Exception Value: Reverse for 'person' not found. 'person' is not a valid view function or pattern name.
avdata99 commented 5 months ago

The search result template /foundation/search/templates/search/results.html includes

{% if search_result.content_type == 'organisation.person' %}
  {% with person=search_result.object %}
    {% include "search/organisation/person.html" %}
  {% endwith %}
{% endif %}

person.html includes

<a class="block text-okfn-sm group" href="{% url 'person' person_id=person.id %}">

And for some reason the person URLs in not availbale

But the URL with name person exists at /foundation/organisation/urls/units.py

re_path(r'^(?P<person_id>\d+)/$', PersonView.as_view(), name='person')
avdata99 commented 5 months ago

This URL fails https://okfn.org/en/who-we-are/our-team/345/ But works for staging https://next.okfn.org/en/who-we-are/our-team/345/ ?

avdata99 commented 5 months ago

Prod: Application is empty for the team page

image

At staging search works and it's connected

image

I updated this for prod, also published pending changes in page but still fails

avdata99 commented 5 months ago

After re-deploying the application now it works. @pdelboca @lucpretti we need to be carefull with the application setting for pages. It looks like if they are not connected the URL is not available and the website can fail

avdata99 commented 5 months ago

@pdelboca I did not manage to find the error

image

Lucas says that he fill the board page with all cards (like at the team page) I didn't delete those card from board but they are not available at the page

The board page shows the cards but they are not editable like in team. The code for both templates include members from code directly

image

The board page is related with BoardAppHook and the teams page with UnitsAppHook It's not clear for me what's happening. Maybe you can take a look and discover what happened.

lucpretti commented 5 months ago

I've just tried to add new blocks to the Team page and it strangely got back to the old layout with old content after I published it. I really think it's related to the applications that were reconnected.

Could you please look into it asap please?

avdata99 commented 5 months ago

@lucpretti, we are getting 500 error again for searches that returns people (internal person URL). I'll look for a different approach. The app needs to be connected to ANY page in order to allow the website to discover this internal person URL