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))]
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 {
return Ok(GetCaptchaResponse { ok: None });

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@ use crate::{
PostUpdateForm,
},
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 diesel::{dsl::insert_into, result::Error, ExpressionMethods, QueryDsl, TextExpressionMethods};
@ -103,8 +103,8 @@ impl Post {
conn: &mut DbConn,
for_creator_id: PersonId,
) -> Result<Vec<Self>, Error> {
let perma_deleted = "*Permananently Deleted*";
let perma_deleted_url = "https://deleted.com";
let _perma_deleted = "*Permananently Deleted*";
let _perma_deleted_url = "https://deleted.com";
diesel::update(post.filter(creator_id.eq(for_creator_id)))
.set((