summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-03-09 19:22:43 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-03-09 19:22:43 +0000
commit00a19f323bb72f29a048934c69d74bf96fe01767 (patch)
tree2f4b5ddc813c403f90067754edb8421c119f1ed2 /app
parent48fc02d24c850c9b5973668bfd448f3c56993564 (diff)
parentb100a9f206ce16391038bf7c2b0bd247b1bfe822 (diff)
downloadgitlab-ce-00a19f323bb72f29a048934c69d74bf96fe01767.tar.gz
Merge branch 'fix-todos' into 'master'
Fix error 500 in Todos Closes #14095 Closes #14075 Closes #14109 Closes #14151 See merge request !3141
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/models/project.rb1
-rw-r--r--app/views/dashboard/todos/_todo.html.haml5
3 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f0aa2b57121..368969c6472 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -72,7 +72,7 @@ module ApplicationHelper
if user_or_email.is_a?(User)
user = user_or_email
else
- user = User.find_by(email: user_or_email.downcase)
+ user = User.find_by(email: user_or_email.try(:downcase))
end
if user
diff --git a/app/models/project.rb b/app/models/project.rb
index 3235a1cee50..426464dee81 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -151,6 +151,7 @@ class Project < ActiveRecord::Base
has_many :releases, dependent: :destroy
has_many :lfs_objects_projects, dependent: :destroy
has_many :lfs_objects, through: :lfs_objects_projects
+ has_many :todos, dependent: :destroy
has_one :import_data, dependent: :destroy, class_name: "ProjectImportData"
diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml
index f878d36e739..45cfe3da188 100644
--- a/app/views/dashboard/todos/_todo.html.haml
+++ b/app/views/dashboard/todos/_todo.html.haml
@@ -4,7 +4,10 @@
.todo-title
%span.author-name
- = link_to_author todo
+ - if todo.author
+ = link_to_author(todo)
+ - else
+ (removed)
%span.todo-label
= todo_action_name(todo)
= todo_target_link(todo)