File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,15 @@ WHERE
109
109
-- Filter by owner_name
110
110
AND CASE
111
111
WHEN @owner_username :: text != ' ' THEN
112
- owner_id = (SELECT id FROM users WHERE lower (username) = lower (@owner_username))
112
+ owner_id = (SELECT id FROM users WHERE lower (username) = lower (@owner_username) AND deleted = false )
113
113
ELSE true
114
114
END
115
115
-- Filter by template_name
116
116
-- There can be more than 1 template with the same name across organizations.
117
117
-- Use the organization filter to restrict to 1 org if needed.
118
118
AND CASE
119
119
WHEN @template_name :: text != ' ' THEN
120
- template_id = ANY(SELECT id FROM templates WHERE lower (name) = lower (@template_name))
120
+ template_id = ANY(SELECT id FROM templates WHERE lower (name) = lower (@template_name) AND deleted = false )
121
121
ELSE true
122
122
END
123
123
-- Filter by template_ids
You can’t perform that action at this time.
0 commit comments