From 147b61655b4ab183d05ab8d7a57f65a039a24c47 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 16 Apr 2023 13:32:14 +0530 Subject: [PATCH] gitweb: Simplify handling shortcut for front page The older code is likely before the card approach was implemented and cached copy had to updated. It is no longer needed as the shortcuts are not filtered based on login required property in the template code. Tests: - When public visibility is enabled/disabled shortcut is properly shown on the frontpage. - When restarting the service the public visibility properly dictates whether shortcut is show properly. Reviewed-by: James Valleroy --- plinth/modules/gitweb/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plinth/modules/gitweb/__init__.py b/plinth/modules/gitweb/__init__.py index 76040f058..1d438fb9e 100644 --- a/plinth/modules/gitweb/__init__.py +++ b/plinth/modules/gitweb/__init__.py @@ -95,9 +95,7 @@ class GitwebApp(app_module.App): def set_shortcut_login_required(self, login_required): """Change the login_required property of shortcut.""" - shortcut = self.remove('shortcut-gitweb') - shortcut.login_required = login_required - self.add(shortcut) + self.get_component('shortcut-gitweb').login_required = login_required def update_service_access(self): """Update the frontpage shortcut and webserver auth requirement."""