mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Fixes #215
Fixed being able to follow yourself; unfollowing yourself is still possible, if it may cause problems in the future.
This commit is contained in:
parent
431b3d5fd9
commit
4e74d048e6
1 changed files with 2 additions and 0 deletions
|
@ -336,6 +336,8 @@ class Site < Sequel::Model
|
|||
follow.delete
|
||||
false
|
||||
else
|
||||
return false if site.id == self.id # Do not follow yourself
|
||||
|
||||
DB.transaction do
|
||||
follow = add_following site_id: site.id
|
||||
Event.create site_id: site.id, actioning_site_id: self.id, follow_id: follow.id
|
||||
|
|
Loading…
Add table
Reference in a new issue