fix: case sensitivity for Subscribed.email (#5270)
This commit is contained in:
parent
963b1bd197
commit
fce28e78f9
ietf
|
@ -125,8 +125,8 @@ def create_account(request):
|
||||||
send_account_creation_email(request, to_email)
|
send_account_creation_email(request, to_email)
|
||||||
|
|
||||||
# The following is what to revert to should that lowered barrier prove problematic
|
# The following is what to revert to should that lowered barrier prove problematic
|
||||||
# existing = Subscribed.objects.filter(email=to_email).first()
|
# existing = Subscribed.objects.filter(email__iexact=to_email).first()
|
||||||
# ok_to_create = ( Allowlisted.objects.filter(email=to_email).exists()
|
# ok_to_create = ( Allowlisted.objects.filter(email__iexact=to_email).exists()
|
||||||
# or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() )
|
# or existing and (existing.time + TimeDelta(seconds=settings.LIST_ACCOUNT_DELAY)) < DateTime.now() )
|
||||||
# if ok_to_create:
|
# if ok_to_create:
|
||||||
# send_account_creation_email(request, to_email)
|
# send_account_creation_email(request, to_email)
|
||||||
|
|
|
@ -77,7 +77,7 @@ def import_mailman_listinfo(verbosity=0):
|
||||||
to_add = members - known
|
to_add = members - known
|
||||||
for addr in to_remove:
|
for addr in to_remove:
|
||||||
note(" Removing subscription: %s" % (addr))
|
note(" Removing subscription: %s" % (addr))
|
||||||
old = Subscribed.objects.get(email=addr)
|
old = Subscribed.objects.get(email=addr) # Intentionally leaving this as case-sensitive in postgres
|
||||||
old.lists.remove(mmlist)
|
old.lists.remove(mmlist)
|
||||||
if old.lists.count() == 0:
|
if old.lists.count() == 0:
|
||||||
note(" Removing address with no subscriptions: %s" % (addr))
|
note(" Removing address with no subscriptions: %s" % (addr))
|
||||||
|
@ -90,7 +90,7 @@ def import_mailman_listinfo(verbosity=0):
|
||||||
continue
|
continue
|
||||||
note(" Adding subscription: %s" % (addr))
|
note(" Adding subscription: %s" % (addr))
|
||||||
try:
|
try:
|
||||||
new, created = Subscribed.objects.get_or_create(email=addr)
|
new, created = Subscribed.objects.get_or_create(email=addr) # Intentionally leaving this as case-sensitive in postgres
|
||||||
except MultipleObjectsReturned as e:
|
except MultipleObjectsReturned as e:
|
||||||
sys.stderr.write(" ** Error handling %s in %s: %s\n" % (addr, name, e))
|
sys.stderr.write(" ** Error handling %s in %s: %s\n" % (addr, name, e))
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue