Skip to content

Commit

Permalink
Merge branch 'fix-collectstatic-proplugins' into 'main'
Browse files Browse the repository at this point in the history
Fix collectstatic for pro plugins

See merge request reportcreator/reportcreator!821
  • Loading branch information
MWedl committed Jan 13, 2025
2 parents 93150b4 + 3468463 commit 0a849e7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/src/reportcreator_api/conf/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ def remove_entry(path: Path):

def can_load_professional_plugins():
license_text = getattr(settings, 'LICENSE', config('LICENSE', default=None))
return license.decode_and_validate_license(license=license_text, skip_db_checks=True) \
.get('type') == license.LicenseType.PROFESSIONAL
if license.decode_and_validate_license(license=license_text, skip_db_checks=True) \
.get('type') == license.LicenseType.PROFESSIONAL:
return True
elif len(sys.argv) >= 2 and sys.argv[0] == 'manage.py' and sys.argv[1] in [
'collectstatic', 'findstatic',
'makemigrations', 'migrate', 'optimizemigrations', 'showmigrations', 'squashmigrations', 'sqlflush', 'sqlmigrate', 'sqlsequencereset',
'check', 'spectacular',
]:
return True
return False


def collect_plugins(dst: Path, srcs: list[Path]):
Expand Down

0 comments on commit 0a849e7

Please sign in to comment.