Require init_main_permission question for webapps, fixed

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
tituspijean 2023-08-18 18:20:31 +02:00
parent 15751d3cd2
commit cf82d0a46b
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720

View file

@ -1942,15 +1942,6 @@ class Manifest(TestSuite):
% argument.get("name") % 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() @test()
def resource_consistency(self): def resource_consistency(self):
@ -1983,6 +1974,16 @@ class Manifest(TestSuite):
"When using a postgresql database, you should add postgresql in apt dependencies." "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() @test()
def manifest_schema(self): def manifest_schema(self):