Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka 2019-05-19 21:53:44 +02:00
commit 08a2af27c3
5 changed files with 12 additions and 8 deletions

View File

@ -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']),

View File

@ -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?

View File

@ -2,7 +2,7 @@
class BlacklistedEmailValidator < ActiveModel::Validator
def validate(user)
return if user.invited?
return if user.valid_invitation?
@email = user.email

View File

@ -294,12 +294,12 @@ sk:
suspend: vylúčený
show:
affected_accounts:
few: "%{count} účty v databáze ovplyvnených"
one: Jeden účet v databáze bol ovplyvnený
other: "%{count} účtov v databáze bolo ovplyvnených"
few: Je ovplyvnených %{count} účtov v databázi
one: Jeden účet v databázi bol ovplyvnený
other: "%{count} účty v databáze boli ovplyvnené"
retroactive:
silence: Zruš stíšenie všetkých momentálne utíšených účtov z tejto domény
suspend: Zruš suspendáciu všetkých momentálne odročených účtov z tejto domény
suspend: Zruš suspendáciu všetkých momentálne ovplyvnených účtov z tejto domény
title: Zruš blokovanie domény %{domain}
undo: Vráť späť
undo: Odvolaj blokovanie domény

View File

@ -8,7 +8,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do
let(:errors) { double(add: nil) }
before do
allow(user).to receive(:invited?) { false }
allow(user).to receive(:valid_invitation?) { false }
allow_any_instance_of(described_class).to receive(:blocked_email?) { blocked_email }
described_class.new.validate(user)
end