Skip to content

Commit ec0b782

Browse files
committed
prevent system users from updating waiting_since
1 parent 76a7352 commit ec0b782

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module ::CommunityCustomFields
4747
on(:post_created) do |post, _opts, user|
4848
topic = post.topic
4949

50-
if user.admin
50+
if user.admin && user.id > 0
5151
# check if user is an admin and update the `waiting_since` field, if so
5252
topic.custom_fields[:waiting_since] = Time.now.utc
5353
topic.save_custom_fields

0 commit comments

Comments
 (0)