From 73309f605a55051314eb248738e0ef85b500997e Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Mon, 29 Apr 2024 08:30:04 +0200 Subject: [PATCH] fix: enable user creation notification (#76) --- controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/users_controller.rb b/controllers/users_controller.rb index d647c9dc..58e7667f 100644 --- a/controllers/users_controller.rb +++ b/controllers/users_controller.rb @@ -99,14 +99,14 @@ class UsersController < ApplicationController private - def create_user + def create_user(send_notifications: true) params ||= @params user = User.find(params["username"]).first error 409, "User with username `#{params["username"]}` already exists" unless user.nil? params.delete("role") unless current_user.admin? user = instance_from_params(User, params) if user.valid? - user.save(send_notifications: false) + user.save(send_notifications: send_notifications) else error 422, user.errors end