From cf82d0a46b79ee702231ac64569a13d966303e03 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 18 Aug 2023 18:20:31 +0200 Subject: [PATCH] Require init_main_permission question for webapps, fixed Co-authored-by: Alexandre Aubin --- package_linter.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/package_linter.py b/package_linter.py index 1e753cb..5a48ba9 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1942,15 +1942,6 @@ class Manifest(TestSuite): % argument.get("name") ) - elif ( - argument.get("name") == "domain" - and not any([a.get("name") == "init_main_permission" for a in args]) - ): - yield Warning( - "You should add a 'init_main_permission' question to have the app ready to be accessed right after installation." - ) - - @test() def resource_consistency(self): @@ -1983,6 +1974,16 @@ class Manifest(TestSuite): "When using a postgresql database, you should add postgresql in apt dependencies." ) + if ( + isinstance(self.manifest["resources"].get('permissions', {}).get('main', {}).get('url'), str) + and "init_main_permission" not in self.manifest['install'] + and not isinstance(self.manifest["resources"].get('permissions', {}).get('main', {}).get('allowed'), str) + ): + yield Warning( + "You should add a 'init_main_permission' question, or define `allowed` for main permission to have the app ready to be accessed right after installation." + ) + + @test() def manifest_schema(self):