mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
refactor User and TrustLevel a bit
* rename `User#password_required` to `User#password_required!` * emails with "i" @ something are a special case as well * get rid of `self.` and returns where possible * prefer "unless a" instead of "if !a" * `unread_notifications` without manually iterating * introduce `User#moderator?` * introduce `TrustLevel#valid_key?`, `TrustLevel#compare`, and `TrustLevel#level_key`
This commit is contained in:
@ -143,7 +143,7 @@ class UsersController < ApplicationController
|
||||
if auth && auth[:email] == params[:email] && auth[:email_valid]
|
||||
user.active = true
|
||||
end
|
||||
user.password_required unless auth
|
||||
user.password_required! unless auth
|
||||
|
||||
DiscourseHub.register_nickname( user.username, user.email ) if user.valid? and SiteSetting.call_discourse_hub?
|
||||
|
||||
|
Reference in New Issue
Block a user