Skip to content

Commit

Permalink
chg: [search] Fixed the search of articles per description.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Nov 21, 2023
1 parent 15f843a commit 86fa566
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions freshermeat/templates/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ <h3>Projects
if (typeof language_param !== 'undefined') {
filters["language"] = language_param;
}
description_param = getUrlParameter('description');
if (typeof description_param !== 'undefined') {
filters["description"] = description_param;
}
// description_param = getUrlParameter('description');
// if (typeof description_param !== 'undefined') {
// filters.push({"name":"description","op":"ilike","val":"%"+description_param+"%"});
Expand Down
2 changes: 1 addition & 1 deletion freshermeat/web/views/api/v2/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get(self):
query = Project.query
for arg in args:
if hasattr(Project, arg):
query = query.filter(getattr(Project, arg) == args[arg])
query = query.filter(getattr(Project, arg).ilike(f"%{args[arg]}%"))
# Filter on other attributes
if project_organization is not None:
query = query.filter(Project.organization.has(name=project_organization))
Expand Down

0 comments on commit 86fa566

Please sign in to comment.