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
37
37
object . topic . custom_fields . slice ( *CommunityCustomFields ::CUSTOM_FIELDS . keys )
38
38
end
39
39
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
+
41
43
topic . custom_fields [ :assignee_id ] = 0
42
44
topic . custom_fields [ :status ] = "new"
43
45
topic . custom_fields [ :waiting_since ] = Time . now . utc
44
46
topic . save_custom_fields
45
47
end
46
48
47
49
on ( :post_created ) do |post , _opts , user |
50
+ return unless post . archetype == "regular" && user . id > 0
51
+
48
52
topic = post . topic
49
53
50
- if user . admin && user . id > 0
54
+ if user . admin
51
55
# check if user is an admin and update the `waiting_since` field, if so
52
56
topic . custom_fields [ :waiting_since ] = Time . now . utc
53
57
topic . save_custom_fields
You can’t perform that action at this time.
0 commit comments