better filter for lowercase email addresses
This commit is contained in:
@@ -55,10 +55,11 @@ class Command(BaseCommand):
|
||||
name = m.subject
|
||||
cntr += 1
|
||||
# get a list of users
|
||||
theusers = User.objects.filter(email=from_address)
|
||||
for u in theusers:
|
||||
try:
|
||||
rr = Rower.objects.get(user=u.id)
|
||||
# theusers = User.objects.filter(email=from_address)
|
||||
ther = [
|
||||
r for r in Rower.objects.all() if r.user.email.lower() == from_address
|
||||
]
|
||||
for rr in ther:
|
||||
if extension == 'zip':
|
||||
z = zipfile.ZipFile(a.document)
|
||||
for f in z.namelist():
|
||||
@@ -92,10 +93,6 @@ class Command(BaseCommand):
|
||||
except:
|
||||
pass
|
||||
|
||||
except Rower.DoesNotExist:
|
||||
pass
|
||||
|
||||
|
||||
# remove attachment
|
||||
if donotdelete == 0:
|
||||
a.delete()
|
||||
|
||||
@@ -211,6 +211,9 @@ class Rower(models.Model):
|
||||
def __str__(self):
|
||||
return self.user.username
|
||||
|
||||
def clean_email(self):
|
||||
return self.user.email.lower()
|
||||
|
||||
# Saving a chart as a favorite chart
|
||||
class FavoriteChart(models.Model):
|
||||
y1params = (
|
||||
|
||||
Reference in New Issue
Block a user