mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-12 13:05:55 +00:00
19 lines
510 B
Rust
19 lines
510 B
Rust
use lemmy_db_schema::source::local_site::RegistrationMode;
|
|
use lemmy_utils::error::LemmyError;
|
|
|
|
mod create;
|
|
mod read;
|
|
mod update;
|
|
|
|
pub fn check_application_question(
|
|
application_question: &Option<Option<String>>,
|
|
registration_mode: RegistrationMode,
|
|
) -> Result<(), LemmyError> {
|
|
if registration_mode == RegistrationMode::RequireApplication
|
|
&& application_question.as_ref().unwrap_or(&None).is_none()
|
|
{
|
|
Err(LemmyError::from_message("application_question_required"))
|
|
} else {
|
|
Ok(())
|
|
}
|
|
}
|