mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 01:11:23 +00:00
fixed more places where NULL category could cause problems when editing issues as admin
This commit is contained in:
parent
784c5832cf
commit
f31668fb44
2 changed files with 4 additions and 3 deletions
|
@ -13,7 +13,8 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
|
||||
allowed = Issue::allowed_categories cuser
|
||||
qstring = "category_id IN (?) OR category_id IS NULL"
|
||||
qstring = 'category_id IN (?)'
|
||||
qstring += ' OR category_id IS NULL' if cuser.admin?
|
||||
|
||||
@open = Issue.where(qstring, allowed).with_status(Issue::STATUS_OPEN).all order: sort
|
||||
@solved = Issue.where(qstring, allowed).with_status(Issue::STATUS_SOLVED).all order: sort
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<%= f.label :title %>
|
||||
<%= f.text_field :title %>
|
||||
</div>
|
||||
<% if cuser and Issue::allowed_categories(cuser).include?(@issue.category_id) %>
|
||||
<% if cuser and (cuser.admin? or Issue::allowed_categories(cuser).include?(@issue.category_id)) %>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :status %>
|
||||
<%= f.select :status, @issue.statuses.invert %>
|
||||
|
@ -22,7 +22,7 @@
|
|||
<%= f.label :text %>
|
||||
<%= f.text_area :text, rows: 7 %>
|
||||
</div>
|
||||
<% if cuser and Issue::allowed_categories(cuser).include?(@issue.category_id) %>
|
||||
<% if cuser and (cuser.admin? or Issue::allowed_categories(cuser).include?(@issue.category_id)) %>
|
||||
<div class="fields horizontal">
|
||||
<%= f.label :solution %>
|
||||
<%= f.text_area :solution, rows: 7 %>
|
||||
|
|
Loading…
Reference in a new issue