Fix stuff broken by merge

pull/3420/head
dull b 2023-06-30 05:13:56 +00:00
parent a6cbbee3c7
commit 9d54354af4
5 changed files with 7 additions and 8 deletions

View File

@ -17,7 +17,7 @@ impl Perform for GetCaptcha {
#[tracing::instrument(skip(context))] #[tracing::instrument(skip(context))]
async fn perform(&self, context: &Data<LemmyContext>) -> Result<Self::Response, LemmyError> { async fn perform(&self, context: &Data<LemmyContext>) -> Result<Self::Response, LemmyError> {
let local_site = LocalSite::read(context.pool()).await?; let local_site = LocalSite::read(&mut *context.conn().await?).await?;
if !local_site.captcha_enabled { if !local_site.captcha_enabled {
return Ok(GetCaptchaResponse { ok: None }); return Ok(GetCaptchaResponse { ok: None });

View File

@ -28,7 +28,7 @@ impl Perform for PasswordReset {
// Check for too many attempts (to limit potential abuse) // Check for too many attempts (to limit potential abuse)
let recent_resets_count = PasswordResetRequest::get_recent_password_resets_count( let recent_resets_count = PasswordResetRequest::get_recent_password_resets_count(
context.pool(), &mut *context.conn().await?,
local_user_view.local_user.id, local_user_view.local_user.id,
) )
.await?; .await?;

View File

@ -11,7 +11,7 @@ use crate::{
CommentUpdateForm, CommentUpdateForm,
}, },
traits::{Crud, Likeable, Saveable}, traits::{Crud, Likeable, Saveable},
utils::{get_conn, naive_now, DbConn, DELETED_REPLACEMENT_TEXT}, utils::{naive_now, DbConn, DELETED_REPLACEMENT_TEXT},
}; };
use diesel::{ use diesel::{
dsl::{insert_into, sql_query}, dsl::{insert_into, sql_query},

View File

@ -80,10 +80,9 @@ impl PasswordResetRequest {
} }
pub async fn get_recent_password_resets_count( pub async fn get_recent_password_resets_count(
pool: &DbPool, conn: &mut DbConn,
user_id: LocalUserId, user_id: LocalUserId,
) -> Result<i64, Error> { ) -> Result<i64, Error> {
let conn = &mut get_conn(pool).await?;
password_reset_request password_reset_request
.filter(local_user_id.eq(user_id)) .filter(local_user_id.eq(user_id))
.filter(published.gt(now - 1.days())) .filter(published.gt(now - 1.days()))

View File

@ -27,7 +27,7 @@ use crate::{
PostUpdateForm, PostUpdateForm,
}, },
traits::{Crud, Likeable, Readable, Saveable}, traits::{Crud, Likeable, Readable, Saveable},
utils::{get_conn, naive_now, DbConn, DbPool, DELETED_REPLACEMENT_TEXT, FETCH_LIMIT_MAX}, utils::{naive_now, DbConn, DELETED_REPLACEMENT_TEXT, FETCH_LIMIT_MAX},
}; };
use ::url::Url; use ::url::Url;
use diesel::{dsl::insert_into, result::Error, ExpressionMethods, QueryDsl, TextExpressionMethods}; use diesel::{dsl::insert_into, result::Error, ExpressionMethods, QueryDsl, TextExpressionMethods};
@ -103,8 +103,8 @@ impl Post {
conn: &mut DbConn, conn: &mut DbConn,
for_creator_id: PersonId, for_creator_id: PersonId,
) -> Result<Vec<Self>, Error> { ) -> Result<Vec<Self>, Error> {
let perma_deleted = "*Permananently Deleted*"; let _perma_deleted = "*Permananently Deleted*";
let perma_deleted_url = "https://deleted.com"; let _perma_deleted_url = "https://deleted.com";
diesel::update(post.filter(creator_id.eq(for_creator_id))) diesel::update(post.filter(creator_id.eq(for_creator_id)))
.set(( .set((