From b1fd0c93dcc7dcbf57f103640916f92478f0d59e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 4 May 2020 16:24:51 -0700 Subject: [PATCH] datetime: Disable diagnostics when no tests are available Closes: #1846 Tests: - When systemd-timesyncd is running, 'Run Diagnostics' button is shown and two diagnostics results are shown. The two results appears on the diagnostics app results too. - When systemd-timesyncd is not running, 'Run Diagnostics' button is not shown. Datetime app is not included the diagnostics app page results. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/datetime/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/modules/datetime/__init__.py b/plinth/modules/datetime/__init__.py index 40e49938e..218ad486e 100644 --- a/plinth/modules/datetime/__init__.py +++ b/plinth/modules/datetime/__init__.py @@ -87,6 +87,10 @@ class DateTimeApp(app_module.App): return results + def has_diagnostics(self): + """Return that app has diagnostics only when time is managed.""" + return self._is_time_managed() + def init(): """Initialize the date/time module."""