From 0848ae64b980056ce045f6f0b14cc1856e48dec8 Mon Sep 17 00:00:00 2001 From: Hynek Cernoch Date: Fri, 19 Jan 2024 14:24:03 +0100 Subject: [PATCH] License code is required also with the latest LTS version --- CHANGELOG.rst | 2 ++ README.rst | 8 ++++---- salesforce/backend/enterprise.py | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 471d4047..173d6efd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -19,6 +19,8 @@ experimental. * Support for Salesforce API 60.0 Spring '24 * Change: Values of ``FloatField`` are now really float, not Decimal as previously. * Add: FloatField is used by ``inspectdb`` in some metadata with negative decimal places. +* A license code is required also with the latest LTS version unless you accept + the AGPL licence. [5.0] 2023-12-07 diff --git a/README.rst b/README.rst index de4b6ca5..d5933aa7 100644 --- a/README.rst +++ b/README.rst @@ -21,8 +21,8 @@ traditional database. Python 3.7 to 3.12, Django 2.0 to 5.0. (Tested also with Python 3.13 alpha 2) -Use with Django 5.0 currently requires an enteprise license key DJSF_LICENSE_KEY -available to sponsors, or to accept an AGPL license if you install our equivalent +Use with Django 5.0 or 4.2(LTS) currently requires an enteprise license key DJSF_LICENSE_KEY +available to sponsors, unless you accept the AGPL license and install our otherwise identical package "django-salesforce-agpl" instead. @@ -98,7 +98,7 @@ Install, configure a Salesforce connection, create a Salesforce model and run. not important.) 5. Add a setting ``DJSF_LICENSE_KEY = "Your Name or Company / email //our.signature=="`` - if you need it for Django 4.2 now. + if you need it for Django 5.0 or 4.2. 6. **Verify** that everything important is configured correctly by running the command ``python manage.py check --database=salesforce``. @@ -301,7 +301,7 @@ Backwards-incompatible changes The most important: -- v4.2: Some new features implemented after June 2023 can require a license key +- v4.2: Some new features or versions implemented after June 2023 can require a license key (sponsorship) or to accept the AGPL license. (AGPL is fine for exclusive open source contribution or for education, but impossible if you do not share all your source codes.) diff --git a/salesforce/backend/enterprise.py b/salesforce/backend/enterprise.py index 645fc01a..879aa8de 100644 --- a/salesforce/backend/enterprise.py +++ b/salesforce/backend/enterprise.py @@ -27,7 +27,7 @@ def check_enterprise_license( # pylint:disable=too-many-locals # A legal way to skip the enterprise check is to use django-salesforce-agpl # - # and accept the restrictive AGPL licence that requires you provide all your Django + # and accept the restrictive AGPL license that requires you provide all your Django # source code where you use django-salesforce available to all users who could # use your project by network (by your web app, by your backend app etc.) and # publish it under a compatible license. @@ -46,11 +46,11 @@ def check_enterprise_license( # pylint:disable=too-many-locals for a in range(q): g, f, d, e = g | (bool(b & e & m) << f), f + bool(m & e), d - bool(j & e), e << r if g != level or level > 3 or d: - raise LicenseError("The enterprise licence key is invalid") + raise LicenseError("The enterprise license key is invalid") def check_license_in_latest_django() -> None: - if django.VERSION[:2] == max_django: + if django.VERSION[:2] in (max_django, (max_django[0] - bool(max_django[1] < 2), 2)): check_enterprise_license( - "License key is required for django-saleforce used with the last Django version. " - "(read about dual-license)") + "License key is required for django-saleforce used with the last Django version " + "or LTS version. (read about dual-license)")