Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Changed query to be case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua LeBlanc committed Mar 20, 2014
1 parent 8173ebd commit a040b61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flamejam/forms.py
Expand Up @@ -10,6 +10,7 @@
import re
from flamejam import app, models, utils
from flamejam.models.rating import RATING_CATEGORIES
from sqlalchemy import func

############## VALIDATORS ####################

Expand Down Expand Up @@ -57,7 +58,7 @@ def __init__(self, pw_field, message_username = "The username or password is inc
self.message_password = message_password

def __call__(self, form, field):
u = models.User.query.filter_by(username = field.data).first()
u = models.User.query.filter(func.lower(models.User.username) == func.lower(field.data)).first()
if not u:
raise ValidationError(self.message_username)
elif not utils.verify_password(u.password, form[self.pw_field].data):
Expand Down

0 comments on commit a040b61

Please sign in to comment.