fix: exception when saving dash (#13300)

* fix: project None value

* fix: pre-commit
This commit is contained in:
Amit Miran 2021-02-24 12:08:28 +02:00 committed by GitHub
parent 0a00153375
commit 29d6420ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1178,7 +1178,10 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
# the dashboard was open. it was use to avoid mid-air collision.
remote_last_modified_time = data.get("last_modified_time")
current_last_modified_time = dash.changed_on.replace(microsecond=0).timestamp()
if remote_last_modified_time < current_last_modified_time:
if (
remote_last_modified_time
and remote_last_modified_time < current_last_modified_time
):
return json_error_response(
__(
"This dashboard was changed recently. "