Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made loan application search case-insensitive #767

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading