File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,21 @@ module ::CommunityCustomFields
3737 object . topic . custom_fields . slice ( *CommunityCustomFields ::CUSTOM_FIELDS . keys )
3838 end
3939
40- on ( :topic_created ) do |topic , _opts , _user |
40+ on ( :topic_created ) do |topic , _opts , user |
41+ return unless topic . archetype == "regular" && user . id > 0
42+
4143 topic . custom_fields [ :assignee_id ] = 0
4244 topic . custom_fields [ :status ] = "new"
4345 topic . custom_fields [ :waiting_since ] = Time . now . utc
4446 topic . save_custom_fields
4547 end
4648
4749 on ( :post_created ) do |post , _opts , user |
50+ return unless post . archetype == "regular" && user . id > 0
51+
4852 topic = post . topic
4953
50- if user . admin && user . id > 0
54+ if user . admin
5155 # check if user is an admin and update the `waiting_since` field, if so
5256 topic . custom_fields [ :waiting_since ] = Time . now . utc
5357 topic . save_custom_fields
You can’t perform that action at this time.
0 commit comments