Project

General

Profile

Actions

Defect #26072

closed

Set default assignee before validation

Added by Felix Schäfer over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Currently the default assignee is set only after validations. This means that when the field is required the default assignee does not work.

The following patch changes setting the default assignee to before the validation:

diff --git a/app/models/issue.rb b/app/models/issue.rb
index 7d411fc94..a5ebfbffa 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -105,8 +105,8 @@ class Issue < ActiveRecord::Base
     end
   }

+  before_validation :default_assign, on: :create
   before_validation :clear_disabled_fields
-  before_create :default_assign
   before_save :close_duplicates, :update_done_ratio_from_issue_status,
               :force_updated_on_change, :update_closed_on, :set_assigned_to_was
   after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}

Files

26072-reproduce.png (56 KB) 26072-reproduce.png Go MAEDA, 2017-05-31 15:32

Related issues

Related to Redmine - Feature #482: Default assignee on each projectClosedJean-Philippe Lang

Actions
Related to Redmine - Feature #26680: Show default assignee when creating new issueNew

Actions
Actions

Also available in: Atom PDF