forked from External/greenlight
GRN2-xx: Switch the relation between users and roles to make queries cleaner and faster (#1299)
* First steps * Fixes in account creation flow * Fixed most testcases * more test fixes * Fixed more test cases * Passing tests and rubocop * Added rake task to remove rooms
This commit is contained in:
@ -218,7 +218,7 @@ class SessionsController < ApplicationController
|
||||
|
||||
# Add pending role if approval method and is a new user
|
||||
if approval_registration && !@user_exists
|
||||
user.add_role :pending
|
||||
user.set_role :pending
|
||||
|
||||
# Inform admins that a user signed up if emails are turned on
|
||||
send_approval_user_signup_email(user)
|
||||
@ -228,6 +228,8 @@ class SessionsController < ApplicationController
|
||||
|
||||
send_invite_user_signup_email(user) if invite_registration && !@user_exists
|
||||
|
||||
user.set_role :user unless @user_exists
|
||||
|
||||
login(user)
|
||||
|
||||
if @auth['provider'] == "twitter"
|
||||
|
Reference in New Issue
Block a user