add: change default avatar
This commit is contained in:
parent
8dfd307919
commit
959a125992
6 changed files with 92 additions and 13 deletions
|
@ -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(),
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue