Open
Conversation
|
This pull request introduces 1 alert when merging 9a0fd1d into 324a9f1 - view on LGTM.com new alerts:
|
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.devbridge-autocomplete/1.4.10/jquery.autocomplete.min.js"></script> | ||
| <script> | ||
| $('#search-bar').autocomplete({ | ||
| serviceUrl: '/autocomplete' |
Collaborator
There was a problem hiding this comment.
Why not use url template tag?
Comment on lines
+150
to
+158
| def autocomplete(request): | ||
| query = request.GET.get('query') | ||
| tags = Tag.objects.filter(name__icontains=query) | ||
| taglist = [] | ||
| for t in tags: | ||
| taglist.append(t.name) | ||
| taglist_json = {"suggestions":taglist} | ||
| taglist_string = json.dumps(taglist_json) | ||
| return HttpResponse(taglist_string) No newline at end of file |
Collaborator
There was a problem hiding this comment.
Instead of using json module, you could also have used Django's JsonResponse to send back a JSON object for autocomplete.
Collaborator
|
There is also the issue of you sending a PR from your master branch. Please see CONTRIBUTING.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ajax search feature added to home page so that users will be able to know what can be searched.