Verified Commit db2dcace authored by paz's avatar paz
Browse files

Re-order sanity-checks.

It makes more sense to first check for the directory, then for the keys.
With a non-existant list-dir we had 'no public key' errors, which are
not helpful.
parent 19afc2f6
......@@ -94,13 +94,6 @@ module Schleuder
return log_and_return(Errors::ListNotFound.new(recipient))
end
# Check basic sanity of list.
%w[fingerprint key secret_key admins].each do |attrib|
if @list.send(attrib).blank?
return log_and_return(Errors::ListPropertyMissing.new(attrib))
end
end
# Check neccessary permissions of crucial files.
if ! File.exist?(@list.listdir)
return log_and_return(Errors::ListdirProblem.new(@list.listdir, :not_existing))
......@@ -116,6 +109,12 @@ module Schleuder
end
end
# Check basic sanity of list.
%w[fingerprint key secret_key admins].each do |attrib|
if @list.send(attrib).blank?
return log_and_return(Errors::ListPropertyMissing.new(attrib))
end
end
# Set locale
if I18n.available_locales.include?(@list.language.to_sym)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment