مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
style(rubocop): Lint/UselessAssignment
هذا الالتزام موجود في:
@@ -33,7 +33,7 @@ class IPPoolsController < ApplicationController
|
||||
def destroy
|
||||
@ip_pool.destroy
|
||||
redirect_to_with_json :ip_pools, notice: "IP pool has been removed successfully."
|
||||
rescue ActiveRecord::DeleteRestrictionError => e
|
||||
rescue ActiveRecord::DeleteRestrictionError
|
||||
redirect_to_with_json [:edit, @ip_pool], alert: "IP pool cannot be removed because it still has associated addresses or servers."
|
||||
end
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ class MessagesController < ApplicationController
|
||||
if qs[:before]
|
||||
begin
|
||||
options[:where][:timestamp][:less_than] = get_time_from_string(qs[:before]).to_f
|
||||
rescue TimeUndetermined => e
|
||||
rescue TimeUndetermined
|
||||
flash.now[:alert] = "Couldn't determine time for before from '#{qs[:before]}'"
|
||||
end
|
||||
end
|
||||
@@ -196,7 +196,7 @@ class MessagesController < ApplicationController
|
||||
if qs[:after]
|
||||
begin
|
||||
options[:where][:timestamp][:greater_than] = get_time_from_string(qs[:after]).to_f
|
||||
rescue TimeUndetermined => e
|
||||
rescue TimeUndetermined
|
||||
flash.now[:alert] = "Couldn't determine time for after from '#{qs[:after]}'"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ class SessionsController < ApplicationController
|
||||
login(User.authenticate(params[:email_address], params[:password]))
|
||||
flash[:remember_login] = true
|
||||
redirect_to_with_return_to root_path
|
||||
rescue Postal::Errors::AuthenticationError => e
|
||||
rescue Postal::Errors::AuthenticationError
|
||||
flash.now[:alert] = "The credentials you've provided are incorrect. Please check and try again."
|
||||
render "new"
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ class IncomingMessagePrototype
|
||||
def route
|
||||
@routes ||= if @to.present?
|
||||
uname, domain = @to.split("@", 2)
|
||||
uname, tag = uname.split("+", 2)
|
||||
uname, _tag = uname.split("+", 2)
|
||||
@server.routes.includes(:domain).where(domains: { name: domain }, name: uname).first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,7 +50,7 @@ class Organization < ApplicationRecord
|
||||
has_many :ip_pool_rules, dependent: :destroy, as: :owner
|
||||
|
||||
after_create do
|
||||
if pool = IPPool.default
|
||||
if IPPool.default
|
||||
ip_pools << IPPool.default
|
||||
end
|
||||
end
|
||||
|
||||
@@ -202,7 +202,7 @@ class Route < ApplicationRecord
|
||||
if route = Route.includes(:domain).where(domains: { name: domain.name }, name: name).where.not(id: id).first
|
||||
errors.add :name, "is configured on the #{route.server.full_permalink} mail server"
|
||||
end
|
||||
elsif route = Route.where(name: "__returnpath__").where.not(id: id).exists?
|
||||
elsif Route.where(name: "__returnpath__").where.not(id: id).exists?
|
||||
errors.add :base, "A return path route already exists for this server"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -232,8 +232,6 @@ class Server < ApplicationRecord
|
||||
return nil unless uname
|
||||
return nil unless domain_name
|
||||
|
||||
uname, = uname.split("+", 2)
|
||||
|
||||
# Find a verified domain which directly matches the domain name for the given address.
|
||||
domain = Domain.verified
|
||||
.order(owner_type: :desc)
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم