Skip to content

Commit

Permalink
made loan application search case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisa Yu committed Sep 27, 2023
1 parent 641579d commit 3820c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ static/
*.mo
*.html.py
*.txt.py
pyenv/
4 changes: 2 additions & 2 deletions inventory/views/item_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_queryset(self):

# Additionally filter by the name of the applicant
if name_filter:
applications = applications.filter(contact_name__contains=name_filter)
applications = applications.filter(contact_name__icontains=name_filter)

return applications.order_by("loan_to")

Expand Down Expand Up @@ -156,7 +156,7 @@ def get_initial(self, *args, **kwargs):
user = self.request.user
if user and user.is_authenticated:
initial_form = {
"contact_name": "{} {}".format(user.first_name, user.last_name),
"contact_name": "{} {}".format(user.first_name, user.last_name), #her
"contact_email": user.email,
}

Expand Down

0 comments on commit 3820c9e

Please sign in to comment.