Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 server error caused by view #99

Open
larsUE opened this issue Oct 31, 2024 · 1 comment
Open

500 server error caused by view #99

larsUE opened this issue Oct 31, 2024 · 1 comment

Comments

@larsUE
Copy link

larsUE commented Oct 31, 2024

We are currently getting a 500 server error in the backend due to the following action:

Method caused in ths view:

    <% if unanswered_proposals_overdue?(proposal) || evaluating_proposals_overdue?(proposal) %>
      <%= icon "timer-line", class: "text-alert" %>
    <% elsif grace_period_unanswered?(proposal) || grace_period_evaluating?(proposal) %>
      <%= icon "timer-line", class: "text-warning" %>
    <% end %>

The error occurs here:

          def grace_period_evaluating?(proposal)
            proposal.evaluating? && Time.current < last_day_to_evaluate(proposal)
          end

Probably because nil is returned here:

          def last_day_to_evaluate(proposal)
            (proposal.answered_at + days_evaluating(proposal).days).to_date if proposal.answered?
          end

https://github.com/openpoke/decidim-module-reporting-proposals/blob/main/app/helpers/concerns/decidim/reporting_proposals/admin/proposals_helper_override.rb#L51

@larsUE
Copy link
Author

larsUE commented Oct 31, 2024

I had all date settings of the component set to 0. As a hotfix, I was able to get rid of the 500 error by setting very large deadlines. No matter here, as we are not using these features for this specific component anyway.

@larsUE larsUE changed the title 500 server error caused view. 500 server error caused by view Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant