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

Changing created to modified time #6234

Merged
Merged
Changes from 4 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
8 changes: 3 additions & 5 deletions readthedocs/search/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def record_search_query(project_slug, version_slug, query, total_results, time_s
partial_query_qs = SearchQuery.objects.filter(
project__slug=project_slug,
version__slug=version_slug,
created__gte=before_10_sec,
).order_by('-created')
modified__gte=before_10_sec,
).order_by('-modified')

# check if partial query exists,
# if yes, then just update the object.
Expand Down Expand Up @@ -205,10 +205,8 @@ def record_search_query(project_slug, version_slug, query, total_results, time_s
version = version_qs.first()

# make a new SearchQuery object.
obj = SearchQuery.objects.create(
SearchQuery.objects.create(
project=project,
version=version,
query=query,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the obj anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but SearchQuery.objects.create this thing is needed right?
okay let me update the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but SearchQuery.objects.create this thing is needed right?

yes

obj.created = time
obj.save()