dhanasingh / redmine_wktime

ERPmine is an open source free ERP for Service Industries. It runs within Redmine
https://erpmine.org/
Other
120 stars 78 forks source link

Remove deliver method call to avoid 500 error on user create #219

Open jeremy5189 opened 3 years ago

jeremy5189 commented 3 years ago

Steps to reproduce

Create a new user on page /users/new with Send account information to the user checked.

Expected behavior

Successfully create a user and redirect to user list

Actual behavior

Internal error page was displayed, with error output in log/production.log:

Completed 500 Internal Server Error in 169ms (ActiveRecord: 140.6ms)

NoMethodError (undefined method `deliver' for #<ActionMailer::DeliveryJob:0x000055d2d7939770>):

plugins/redmine_wktime/lib/userscontroller_patch.rb:12:in `create'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'

System configuration

Fix

app/models/mailer.rb:352 in redmine 4.1.1 already called method deliver_later. It's therefore not required to call deliver method again in lib/userscontroller_patch.rb:12