SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 1d98dce9 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Ensure that a field/lookup combo occurs at most once in queriesList

parent f4503338
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ Django==2.2.24 # 2021-06-11
feedparser==5.2.1 # Check: not updated since 2016
psycopg2==2.8.6 # 2020-09-19 PostgreSQL engine
pytz==2017.2 # Timezone package
# djangorestframework==3.9.3 # 2019-12-05 IMPORTANT: update templates/rest_framework/base.html if corresponding file rest_framework/templates/rest_framework/base.html has changed
# djangorestframework==3.9.3 # DEPREC, see next entry -- 2019-12-05 IMPORTANT: update templates/rest_framework/base.html if corresponding file rest_framework/templates/rest_framework/base.html has changed
git+git://github.com/SciPost/django-rest-framework.git@bootstrap-v5
requests==2.25.1 # 2021-05-21
pyotp==2.2.7
......
......@@ -237,7 +237,13 @@ export default {
const getAllowedLookups = () => {
if (newQueryField.value) {
allowedLookups.value = filteringFieldsAdvanced.value.find(
el => el.field == newQueryField.value).lookups
el => el.field == newQueryField.value
).lookups.filter( // remove already-used lookups
item => !queriesList.value.some( el => {
return (el.field === newQueryField.value &&
el.lookup === item)
})
)
// Set choice to first value by default
newQueryLookup.value = allowedLookups.value[0]
}
......@@ -324,6 +330,7 @@ export default {
watch(basicSearchQuery, getObjects)
watch(perPage, () => currentPage.value = 1)
watch(newQueryField, getAllowedLookups)
watch(queriesList, () => { if (newQueryField.value) getAllowedLookups()}) // to cover binning a query
watch(queryParameters, getObjects)
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment