Remove unreachable code

This commit is contained in:
Kitaiti Makoto 2022-01-12 08:59:41 +09:00
parent e31a2238fb
commit 5d58b31f1c

View File

@ -4,11 +4,7 @@ use crate::{
template_utils::{IntoContext, Ructe}, template_utils::{IntoContext, Ructe},
}; };
use plume_models::{ use plume_models::{
db_conn::DbConn, db_conn::DbConn, email_signups::EmailSignup, instance::Instance, lettre::Transport, signups,
email_signups::EmailSignup,
instance::Instance,
lettre::Transport,
signups::{self, Strategy as SignupStrategy},
Error, PlumeRocket, CONFIG, Error, PlumeRocket, CONFIG,
}; };
use rocket::{ use rocket::{
@ -75,17 +71,6 @@ pub fn create(
rockets: PlumeRocket, rockets: PlumeRocket,
_enabled: signups::Email, _enabled: signups::Email,
) -> Result<RespondOrRedirect, Ructe> { ) -> Result<RespondOrRedirect, Ructe> {
if !matches!(CONFIG.signup, SignupStrategy::Email) {
return Ok(Flash::error(
Redirect::to(uri!(super::user::new)),
i18n!(
rockets.intl.catalog,
"Email registrations are not enabled. Please restart."
),
)
.into());
}
let registration_open = !Instance::get_local() let registration_open = !Instance::get_local()
.map(|i| i.open_registrations) .map(|i| i.open_registrations)
.unwrap_or(true); .unwrap_or(true);