mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-12 04:55:55 +00:00
d8722b6e91
* Adding diesel enums for SortType and ListingType - Uses diesel-derive-enum. - Adds diesel.toml , so we can again use the auto-generated schema.rs - Fixes a lot of DB null issues and column ordering issues. - Fixes #1136 - Also replaces RegistrationMode boilerplate. * Fixing unit tests 1. * Remove comment line. * Before patch. * Before again. * Using patch file to fix diesel_ltree issue with diesel.toml * Adding some yalc ignores * Fixing RegistrationMode enums * Adding woodpecker diesel schema check. * Try adding openssl 1. * Try using diesel-cli image 1 * Try using diesel-cli image 2 * Try using diesel-cli image 3 * Try using diesel-cli image 4 * Try using diesel-cli image 5 * Try using diesel-cli image 6 * Try using diesel-cli image 7 * Try using diesel-cli image 8 * Try using diesel-cli image 9 * Try using diesel-cli image 10 * Try using diesel-cli image 11 * Try using diesel-cli image 12 * Try using diesel-cli image 13
19 lines
490 B
Rust
19 lines
490 B
Rust
use lemmy_db_schema::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(())
|
|
}
|
|
}
|