django-solomon 0.4.2__tar.gz → 0.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {django_solomon-0.4.2 → django_solomon-0.4.3}/CHANGELOG.md +10 -3
  2. {django_solomon-0.4.2 → django_solomon-0.4.3}/PKG-INFO +3 -2
  3. {django_solomon-0.4.2 → django_solomon-0.4.3}/README.md +2 -1
  4. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/apps.py +1 -2
  5. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/migrations/0003_add_unique_constraint_auth_user_email.py +1 -2
  6. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_migrations.py +3 -2
  7. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_models.py +12 -8
  8. {django_solomon-0.4.2 → django_solomon-0.4.3}/.forgejo/workflows/release.yml +0 -0
  9. {django_solomon-0.4.2 → django_solomon-0.4.3}/.forgejo/workflows/tests.yml +0 -0
  10. {django_solomon-0.4.2 → django_solomon-0.4.3}/.gitignore +0 -0
  11. {django_solomon-0.4.2 → django_solomon-0.4.3}/.pre-commit-config.yaml +0 -0
  12. {django_solomon-0.4.2 → django_solomon-0.4.3}/.readthedocs.yml +0 -0
  13. {django_solomon-0.4.2 → django_solomon-0.4.3}/LICENSE +0 -0
  14. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/changelog.md +0 -0
  15. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/contributing.md +0 -0
  16. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/index.md +0 -0
  17. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/installation.md +0 -0
  18. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/requirements.txt +0 -0
  19. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/settings.md +0 -0
  20. {django_solomon-0.4.2 → django_solomon-0.4.3}/docs/templates.md +0 -0
  21. {django_solomon-0.4.2 → django_solomon-0.4.3}/justfile +0 -0
  22. {django_solomon-0.4.2 → django_solomon-0.4.3}/mkdocs.yml +0 -0
  23. {django_solomon-0.4.2 → django_solomon-0.4.3}/pyproject.toml +0 -0
  24. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/__init__.py +0 -0
  25. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/admin.py +0 -0
  26. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/backends.py +0 -0
  27. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/config.py +0 -0
  28. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/forms.py +0 -0
  29. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/locale/de/LC_MESSAGES/django.po +0 -0
  30. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/locale/en/LC_MESSAGES/django.po +0 -0
  31. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/management/__init__.py +0 -0
  32. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/management/commands/__init__.py +0 -0
  33. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/migrations/0001_initial.py +0 -0
  34. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/migrations/0002_magiclink_ip_address.py +0 -0
  35. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/migrations/__init__.py +0 -0
  36. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/models.py +0 -0
  37. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/py.typed +0 -0
  38. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/templates/django_solomon/base/invalid_magic_link.html +0 -0
  39. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/templates/django_solomon/base/login_form.html +0 -0
  40. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/templates/django_solomon/base/magic_link_sent.html +0 -0
  41. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/templates/django_solomon/email/magic_link.mjml +0 -0
  42. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/templates/django_solomon/email/magic_link.txt +0 -0
  43. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/urls.py +0 -0
  44. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/utilities.py +0 -0
  45. {django_solomon-0.4.2 → django_solomon-0.4.3}/src/django_solomon/views.py +0 -0
  46. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/.gitignore +0 -0
  47. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/__init__.py +0 -0
  48. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/conftest.py +0 -0
  49. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/settings.py +0 -0
  50. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/templates/base.html +0 -0
  51. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_admin.py +0 -0
  52. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_backends.py +0 -0
  53. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_config.py +0 -0
  54. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_forms.py +0 -0
  55. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_urls.py +0 -0
  56. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_utilities.py +0 -0
  57. {django_solomon-0.4.2 → django_solomon-0.4.3}/tests/test_views.py +0 -0
  58. {django_solomon-0.4.2 → django_solomon-0.4.3}/tox.ini +0 -0
  59. {django_solomon-0.4.2 → django_solomon-0.4.3}/uv.lock +0 -0
@@ -5,12 +5,19 @@ All notable changes to django-solomon will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.3] - Unreleased
9
+
10
+ ### Changed
11
+
12
+ - Changed email uniqueness constraint to use standard fields approach for better database compatibility
13
+ - Removed case-insensitivity from email uniqueness constraint to support all database backends
14
+ - Updated tests to verify new constraint behavior
15
+
8
16
  ## [0.4.2] - 2025-04-21
9
17
 
10
- ### Improved
18
+ ### Changed
11
19
 
12
- - Enhanced case-insensitive email uniqueness constraint implementation
13
- - Added regression test to verify constraint behavior
20
+ - Maintenance release with minor improvements and bug fixes
14
21
 
15
22
  ## [0.4.1] - 2025-04-20
16
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-solomon
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: A Django app for passwordless authentication using magic links.
5
5
  Project-URL: Home, https://django-solomon.rtfd.io/
6
6
  Project-URL: Documentation, https://django-solomon.rtfd.io/
@@ -72,7 +72,8 @@ A Django app for passwordless authentication using magic links.
72
72
  - Privacy-focused IP anonymization
73
73
  - Customizable templates for emails and pages
74
74
  - Compatible with Django's authentication system
75
- - Enforces unique email addresses for users (case-insensitive)
75
+ - Enforces unique email addresses for users (Code is taken
76
+ from [django-unique-user-email](https://github.com/carltongibson/django-unique-user-email). Thanks!)
76
77
 
77
78
  ## Installation
78
79
 
@@ -20,7 +20,8 @@ A Django app for passwordless authentication using magic links.
20
20
  - Privacy-focused IP anonymization
21
21
  - Customizable templates for emails and pages
22
22
  - Compatible with Django's authentication system
23
- - Enforces unique email addresses for users (case-insensitive)
23
+ - Enforces unique email addresses for users (Code is taken
24
+ from [django-unique-user-email](https://github.com/carltongibson/django-unique-user-email). Thanks!)
24
25
 
25
26
  ## Installation
26
27
 
@@ -1,5 +1,4 @@
1
1
  from django.apps import AppConfig
2
- from django.db.models.functions import Lower
3
2
 
4
3
 
5
4
  class DjangoSolomonConfig(AppConfig):
@@ -21,7 +20,7 @@ class DjangoSolomonConfig(AppConfig):
21
20
  # But setting a constraint does not...
22
21
  User.Meta.constraints = [
23
22
  models.UniqueConstraint(
24
- Lower("email"),
23
+ fields=["email"],
25
24
  name="unique_user_email",
26
25
  # deferrable=models.Deferrable.DEFERRED,
27
26
  ),
@@ -1,5 +1,4 @@
1
1
  from django.db import migrations, models
2
- from django.db.models.functions import Lower
3
2
 
4
3
 
5
4
  # Copyright (c) 2023 Carlton Gibson
@@ -36,7 +35,7 @@ class Migration(migrations.Migration):
36
35
  CustomAddConstraint(
37
36
  model_name="user",
38
37
  constraint=models.UniqueConstraint(
39
- Lower("email"),
38
+ fields=["email"],
40
39
  name="unique_user_email",
41
40
  ),
42
41
  ),
@@ -42,8 +42,9 @@ class TestMigrations:
42
42
  # Run makemigrations specifically for the auth app to check if it detects changes
43
43
  # to the User model that need new migrations
44
44
  with patch("sys.stdout", makemigrations_stdout):
45
- # Since we've updated the migration to use a case-insensitive constraint with Lower,
46
- # we expect Django to detect a need to remove the old constraint and add the new one.
45
+ # Since we've updated the migration to use a case-sensitive constraint with fields=["email"]
46
+ # instead of a case-insensitive constraint with Lower("email"), we expect Django to detect
47
+ # a need to remove the old constraint and add the new one.
47
48
  # This is expected behavior and not a bug.
48
49
  try:
49
50
  # The --check flag will raise a SystemExit if migrations are needed
@@ -235,21 +235,25 @@ class TestUserEmailUniqueConstraint:
235
235
  password="password456",
236
236
  )
237
237
 
238
- def test_user_email_unique_constraint_case_insensitive(self, user):
239
- """Test that the email uniqueness is case-insensitive at runtime."""
238
+ def test_user_email_unique_constraint_case_sensitive(self, user):
239
+ """Test that the email uniqueness is case-sensitive at runtime."""
240
240
  User = get_user_model()
241
241
 
242
242
  # The user fixture already creates a user with email "test@example.com"
243
- # Attempting to create another user with the same email in different case should fail
244
- # because the constraint is made case-insensitive at runtime in apps.py
245
- with pytest.raises(IntegrityError):
246
- # Create the user directly in the database to bypass Django's validation
247
- # which would prevent the creation due to the runtime constraint
248
- User.objects.create(
243
+ # Attempting to create another user with the same email in different case should succeed
244
+ # because the constraint is case-sensitive
245
+ try:
246
+ new_user = User.objects.create(
249
247
  username="another_user",
250
248
  email="TEST@example.com", # Same email as the fixture user but with different case
251
249
  password="password456",
252
250
  )
251
+ # Verify the user was created
252
+ assert new_user.pk is not None
253
+ assert new_user.email == "TEST@example.com"
254
+ except IntegrityError:
255
+ # If this fails, it means the constraint is still case-insensitive
256
+ assert False, "Expected to create a user with the same email in different case, but it failed" # noqa: B011
253
257
 
254
258
  def test_different_emails_allowed(self, user):
255
259
  """Test that users with different emails can be created."""
File without changes
File without changes
File without changes
File without changes