Merge branch 'master' into glitch-soc/merge-upstream
This commit is contained in:
@@ -20,7 +20,7 @@ const mapStateToProps = state => ({
|
||||
focusDate: state.getIn(['compose', 'focusDate']),
|
||||
caretPosition: state.getIn(['compose', 'caretPosition']),
|
||||
preselectDate: state.getIn(['compose', 'preselectDate']),
|
||||
is_submitting: state.getIn(['compose', 'is_submitting']),
|
||||
isSubmitting: state.getIn(['compose', 'is_submitting']),
|
||||
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
|
||||
isUploading: state.getIn(['compose', 'is_uploading']),
|
||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
||||
|
||||
@@ -114,6 +114,10 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def invited?
|
||||
invite_id.present?
|
||||
end
|
||||
|
||||
def valid_invitation?
|
||||
invite_id.present? && invite.valid_for_use?
|
||||
end
|
||||
|
||||
@@ -274,7 +278,7 @@ class User < ApplicationRecord
|
||||
private
|
||||
|
||||
def set_approved
|
||||
self.approved = open_registrations? || invited? || external?
|
||||
self.approved = open_registrations? || valid_invitation? || external?
|
||||
end
|
||||
|
||||
def open_registrations?
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class BlacklistedEmailValidator < ActiveModel::Validator
|
||||
def validate(user)
|
||||
return if user.invited?
|
||||
return if user.valid_invitation?
|
||||
|
||||
@email = user.email
|
||||
|
||||
|
||||
Reference in New Issue
Block a user