django-solomon 0.4.0__py3-none-any.whl → 0.4.2__py3-none-any.whl

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.
django_solomon/apps.py CHANGED
@@ -1,6 +1,31 @@
1
1
  from django.apps import AppConfig
2
+ from django.db.models.functions import Lower
2
3
 
3
4
 
4
5
  class DjangoSolomonConfig(AppConfig):
5
6
  default_auto_field = "django.db.models.BigAutoField"
6
7
  name = "django_solomon"
8
+
9
+ def ready(self):
10
+ # Copyright (c) 2023 Carlton Gibson
11
+ # This migration is taken from the fantastic project `django-unique-user-email` created by Carlton Gibson.
12
+ # https://github.com/carltongibson/django-unique-user-email/
13
+
14
+ from django.contrib.auth.models import User
15
+ from django.db import models
16
+
17
+ # Updating the field itself triggers the auto-detector
18
+ # field = User._meta.get_field("email")
19
+ # field._unique = True
20
+ #
21
+ # But setting a constraint does not...
22
+ User.Meta.constraints = [
23
+ models.UniqueConstraint(
24
+ Lower("email"),
25
+ name="unique_user_email",
26
+ # deferrable=models.Deferrable.DEFERRED,
27
+ ),
28
+ ]
29
+ User._meta.constraints = User.Meta.constraints
30
+ # ... as long as original_attrs is not updated.
31
+ # User._meta.original_attrs["constraints"] = User.Meta.constraints
@@ -37,7 +37,7 @@ class Migration(migrations.Migration):
37
37
  model_name="user",
38
38
  constraint=models.UniqueConstraint(
39
39
  Lower("email"),
40
- name="unique_user_email"
40
+ name="unique_user_email",
41
41
  ),
42
42
  ),
43
43
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-solomon
3
- Version: 0.4.0
3
+ Version: 0.4.2
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/
@@ -1,6 +1,6 @@
1
1
  django_solomon/__init__.py,sha256=4GdjeQVyChzdc7pZ1jrpknjcnu9Do_0nSh42UZNICKo,80
2
2
  django_solomon/admin.py,sha256=hwesCOQgUDDHPh5qq97AObfSyMgIOKsdzoa69naMPx4,1428
3
- django_solomon/apps.py,sha256=glfjdSSzrxuwJ2FrzuF2C4oFNqikMqhSHHmca2qq5Vg,159
3
+ django_solomon/apps.py,sha256=B2AuqDt19J4pUMSW6cyE9kjydHIhzJ9YZGWOoGA3_WI,1157
4
4
  django_solomon/backends.py,sha256=3RN4dsCehg5urp9sfASERFda1VR9nislNvHrxUc7rXM,3171
5
5
  django_solomon/config.py,sha256=JEl3cY0BnfC9ja0ZVeLmfIwUStbUAO6vRhGZrrig5Yw,787
6
6
  django_solomon/forms.py,sha256=ymDsZ-KWyJfo12vGbZCxIhIvVket93xYR4MgDif4fh0,312
@@ -15,14 +15,14 @@ django_solomon/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
15
15
  django_solomon/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  django_solomon/migrations/0001_initial.py,sha256=i-UhR1KQ4p7WmbDg9xUQfMmDo8yYdIigvHNsefLHJEc,1981
17
17
  django_solomon/migrations/0002_magiclink_ip_address.py,sha256=hs3MISYV7IHEqF-vELCmFtzhhvK8GEHkZu8RMc4X1YU,432
18
- django_solomon/migrations/0003_add_unique_constraint_auth_user_email.py,sha256=9-etXYGGm72G5bmeSdQNpxfQsVl2fTPLyt2sP-CK0G0,1529
18
+ django_solomon/migrations/0003_add_unique_constraint_auth_user_email.py,sha256=7jaQJsFVcJOCGQvfplBXF1y1e2w47FhWtHyWALlP5Yg,1530
19
19
  django_solomon/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  django_solomon/templates/django_solomon/base/invalid_magic_link.html,sha256=3U4T2n4uvPvktiOOHYVyNmk0aXFfE4DPrURE1DinWKk,554
21
21
  django_solomon/templates/django_solomon/base/login_form.html,sha256=VYGnrno3c36W9f04XdRqJpjsDfOy0sq5D_cLayPz8Q0,546
22
22
  django_solomon/templates/django_solomon/base/magic_link_sent.html,sha256=GIMxnw3E98TXVkVQkMRTHmX5mz0xUsvgXVj25gO2HPQ,461
23
23
  django_solomon/templates/django_solomon/email/magic_link.mjml,sha256=OnfVGm2yFrOmoQ1syo6-Duq_Qraf3Tv0Vy5oidvt55g,1427
24
24
  django_solomon/templates/django_solomon/email/magic_link.txt,sha256=yl01eie3U2HkFEJvB1Qlm8Z6FPuop5yubDXFY5V507Q,502
25
- django_solomon-0.4.0.dist-info/METADATA,sha256=Hi9StTi9V1wK7U1HEeYG1PJiycawWMkrbzQHCns8EX0,10409
26
- django_solomon-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- django_solomon-0.4.0.dist-info/licenses/LICENSE,sha256=tbfFOFdH5mHIfmNGo6KGOC3U8f-hTCLfetcr8A89WwI,1071
28
- django_solomon-0.4.0.dist-info/RECORD,,
25
+ django_solomon-0.4.2.dist-info/METADATA,sha256=_ucTPWF-w8RcZnOsdFvL6OIBSmz8pNO9ukt3Kj1i9l8,10409
26
+ django_solomon-0.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ django_solomon-0.4.2.dist-info/licenses/LICENSE,sha256=tbfFOFdH5mHIfmNGo6KGOC3U8f-hTCLfetcr8A89WwI,1071
28
+ django_solomon-0.4.2.dist-info/RECORD,,