Avoid error 500 when todo author was removed
This commit is contained in:
parent
cac83cead5
commit
7500a12aae
|
@ -72,7 +72,7 @@ module ApplicationHelper
|
||||||
if user_or_email.is_a?(User)
|
if user_or_email.is_a?(User)
|
||||||
user = user_or_email
|
user = user_or_email
|
||||||
else
|
else
|
||||||
user = User.find_by(email: user_or_email.downcase)
|
user = User.find_by(email: user_or_email.try(:downcase))
|
||||||
end
|
end
|
||||||
|
|
||||||
if user
|
if user
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
|
|
||||||
.todo-title
|
.todo-title
|
||||||
%span.author-name
|
%span.author-name
|
||||||
= link_to_author todo
|
- if todo.author
|
||||||
|
= link_to_author(todo)
|
||||||
|
- else
|
||||||
|
(removed)
|
||||||
%span.todo-label
|
%span.todo-label
|
||||||
= todo_action_name(todo)
|
= todo_action_name(todo)
|
||||||
= todo_target_link(todo)
|
= todo_target_link(todo)
|
||||||
|
|
Loading…
Reference in New Issue