Skip to content

Commit

Permalink
License code is required also with the latest LTS version
Browse files Browse the repository at this point in the history
  • Loading branch information
hynekcer committed Jan 19, 2024
1 parent a1fab7b commit 0848ae6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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``.
Expand Down Expand Up @@ -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.)
Expand Down
10 changes: 5 additions & 5 deletions salesforce/backend/enterprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# <https://github.com/django-salesforce/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.
Expand All @@ -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)")

0 comments on commit 0848ae6

Please sign in to comment.