samchen2009 / ekanban

a kanban plugin for redmine
102 stars 42 forks source link

[Patch] Creating ticket without asignee causes 500 #58

Closed mickem closed 10 years ago

mickem commented 10 years ago

Seems if there is no asignee (which for some reason is default here) you get a 500 internal error message.

Patch for this:

--- a/lib/ekanban/issue_patch.rb
+++ b/lib/ekanban/issue_patch.rb
@@ -93,6 +93,10 @@ module EKanban
           end

           assignee = issue.assigned_to
+          if assignee.nil?
+            errors.add :assigned_to_id, ":Need to specify an assignee"
+            return false
+          end
           wip = assignee.is_a?(Group) ? assignee.wip(pane.role_id, issue.project_id) : assignee.wip
           wip_limit = assignee.wip_limit
           if pane.in_progress == true and wip >= wip_limit
samchen2009 commented 10 years ago

LGTM, why not submit a "pull request"? Thanks !