]> source.dussan.org Git - redmine.git/commitdiff
Do not fire a query to get user default query when user has no default query set...
authorGo MAEDA <maeda@farend.jp>
Mon, 21 Mar 2022 06:10:54 +0000 (06:10 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 21 Mar 2022 06:10:54 +0000 (06:10 +0000)
Patch by Dmitry Makurin.

git-svn-id: https://svn.redmine.org/redmine/trunk@21485 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_query.rb

index 5a3e14474d68767fb586b38a9aa7e24892d4879c..e7ac1c821f99a597814ac16653a0b49df20065c8 100644 (file)
@@ -80,7 +80,7 @@ class IssueQuery < Query
   def self.default(project: nil, user: User.current)
     query = nil
     # user default
-    if user&.logged? && (query_id = user.pref.default_issue_query)
+    if user&.logged? && (query_id = user.pref.default_issue_query).present?
       query = find_by(id: query_id)
     end
     # project default