add: change default avatar

This commit is contained in:
trisua 2025-07-14 22:05:59 -04:00
parent 8dfd307919
commit 959a125992
6 changed files with 92 additions and 13 deletions

View file

@ -165,9 +165,11 @@ impl DataManager {
let owner = self.get_user_by_id(data.owner).await?;
if !owner.permissions.check(FinePermission::SUPPORTER) {
let stacks = self.get_stacks_by_user(data.owner).await?;
let stacks = self
.get_table_row_count_where("stacks", &format!("owner = {}", owner.id))
.await? as usize;
if stacks.len() >= Self::MAXIMUM_FREE_STACKS {
if stacks >= Self::MAXIMUM_FREE_STACKS {
return Err(Error::MiscError(
"You already have the maximum number of stacks you can have".to_string(),
));