mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Flush cache for undeletes - dont show profile disabled site suggestions
This commit is contained in:
parent
dffba2a532
commit
bf00086074
1 changed files with 3 additions and 1 deletions
|
@ -500,6 +500,8 @@ class Site < Sequel::Model
|
||||||
self.is_deleted = false
|
self.is_deleted = false
|
||||||
save_changes
|
save_changes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete_all_cache
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1500,7 +1502,7 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def suggestions(limit=SUGGESTIONS_LIMIT, offset=0)
|
def suggestions(limit=SUGGESTIONS_LIMIT, offset=0)
|
||||||
suggestions_dataset = Site.exclude(id: id).exclude(is_deleted: true).exclude(is_nsfw: true).order(:views.desc, :updated_at.desc)
|
suggestions_dataset = Site.exclude(id: id).exclude(is_deleted: true).exclude(is_nsfw: true).exclude(profile_enabled: false).order(:views.desc, :updated_at.desc)
|
||||||
suggestions = suggestions_dataset.where(tags: tags).limit(limit, offset).all
|
suggestions = suggestions_dataset.where(tags: tags).limit(limit, offset).all
|
||||||
|
|
||||||
return suggestions if suggestions.length == limit
|
return suggestions if suggestions.length == limit
|
||||||
|
|
Loading…
Add table
Reference in a new issue