Repository: getredash/redash

Issue:
The 'Create your first Dashboard' newbie link will not dispear even I create dashboards
### Issue Summary

The 'Create your first Dashboard' newbie link will not dispear even I create dashboards. Other newbie link works fine. I tried a completely new Redash instance, this issue still exists. I remember there is a commit related to the newbie link recently, but I cannot find which. This issue does not exists in the previous Docker preview image, so I assume that it should be related to recent commits.

### Steps to Reproduce

1. Create new dashboards.
2. The link still there.

<img width="280" alt="image" src="https://github.com/getredash/redash/assets/8188177/19555165-b2df-4b07-89cf-7443858ca704">

### Technical details:

* Redash Version: 23.10.0-dev (dev)
* Browser/OS: Chrome 118
* How did you install Redash: Docker

The 'Create your first Dashboard' newbie link will not dispear even I create dashboards
### Issue Summary

The 'Create your first Dashboard' newbie link will not dispear even I create dashboards. Other newbie link works fine. I tried a completely new Redash instance, this issue still exists. I remember there is a commit related to the newbie link recently, but I cannot find which. This issue does not exists in the previous Docker preview image, so I assume that it should be related to recent commits.

### Steps to Reproduce

1. Create new dashboards.
2. The link still there.

<img width="280" alt="image" src="https://github.com/getredash/redash/assets/8188177/19555165-b2df-4b07-89cf-7443858ca704">

### Technical details:

* Redash Version: 23.10.0-dev (dev)
* Browser/OS: Chrome 118
* How did you install Redash: Docker



Discussion:
Well, that's clearly a bug. :wink:
This seems to be a bug introduced by #6167.

https://github.com/getredash/redash/commit/9b2f635692741396def5b78e0ba0d564a852de6f#diff-f7dc04ba20ba742413851922998a25301eec334c2f3836eb5d1e99b730ddddefR18
It seems to stem from SQLAlchemy, specifically: the `==` comparison operator is overloaded for `Column` but you can't overload `is`. So it's comparing a `Column` to `False`, and that's clearly not identical. [Relevant link](https://stackoverflow.com/a/48275373)

It seems elsewhere in the code that defines `Dashboard`, we use `is_`, so that should be an easy change to make.
Well, that's clearly a bug. :wink:
This seems to be a bug introduced by #6167.

https://github.com/getredash/redash/commit/9b2f635692741396def5b78e0ba0d564a852de6f#diff-f7dc04ba20ba742413851922998a25301eec334c2f3836eb5d1e99b730ddddefR18
It seems to stem from SQLAlchemy, specifically: the `==` comparison operator is overloaded for `Column` but you can't overload `is`. So it's comparing a `Column` to `False`, and that's clearly not identical. [Relevant link](https://stackoverflow.com/a/48275373)

It seems elsewhere in the code that defines `Dashboard`, we use `is_`, so that should be an easy change to make.

Resolving patch:
diff --git a/redash/handlers/organization.py b/redash/handlers/organization.py
--- a/redash/handlers/organization.py
+++ b/redash/handlers/organization.py
@@ -15,7 +15,7 @@ def organization_status(org_slug=None):
         "data_sources": models.DataSource.all(current_org, group_ids=current_user.group_ids).count(),
         "queries": models.Query.all_queries(current_user.group_ids, current_user.id, include_drafts=True).count(),
         "dashboards": models.Dashboard.query.filter(
-            models.Dashboard.org == current_org, models.Dashboard.is_archived is False
+            models.Dashboard.org == current_org, models.Dashboard.is_archived.is_(False)
         ).count(),
     }
 


Test patch: