Only send "Account was created for you" email when created by admin.

This commit is contained in:
Douwe Maan 2015-02-13 15:30:54 +01:00
parent 529188e478
commit 4a62a0f01a
1 changed files with 1 additions and 1 deletions

View File

@ -556,7 +556,7 @@ class User < ActiveRecord::Base
def post_create_hook
log_info("User \"#{self.name}\" (#{self.email}) was created")
notification_service.new_user(self, @reset_token)
notification_service.new_user(self, @reset_token) if self.created_by_id
system_hook_service.execute_hooks_for(self, :create)
end