Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Re2o
re2o
Commits
9669ab68
Commit
9669ab68
authored
Jan 02, 2021
by
chirac
Committed by
Gabriel Detraz
Jan 24, 2021
Browse files
Unlogged->LoggedOut
parent
bdf1a14f
Changes
3
Hide whitespace changes
Inline
Side-by-side
re2o/views.py
View file @
9669ab68
...
...
@@ -173,7 +173,7 @@ def handler404(request):
return
render
(
request
,
"errors/404.html"
,
status
=
404
)
class
Autocomplete
Unl
oggedViewMixin
(
autocomplete
.
Select2QuerySetView
):
class
Autocomplete
L
ogged
Out
ViewMixin
(
autocomplete
.
Select2QuerySetView
):
obj_type
=
None
# This MUST be overridden by child class
query_set
=
None
query_filter
=
"name__icontains"
# Override this if necessary
...
...
@@ -195,6 +195,6 @@ class AutocompleteUnloggedViewMixin(autocomplete.Select2QuerySetView):
return
self
.
query_set
class
AutocompleteViewMixin
(
LoginRequiredMixin
,
Autocomplete
Unl
oggedViewMixin
):
class
AutocompleteViewMixin
(
LoginRequiredMixin
,
Autocomplete
L
ogged
Out
ViewMixin
):
pass
topologie/views_autocomplete.py
View file @
9669ab68
...
...
@@ -36,10 +36,10 @@ from django.db.models.functions import Concat
from
.models
import
Room
,
Dormitory
,
Building
,
Switch
,
PortProfile
,
Port
,
SwitchBay
from
re2o.views
import
AutocompleteViewMixin
,
Autocomplete
Unl
oggedViewMixin
from
re2o.views
import
AutocompleteViewMixin
,
Autocomplete
L
ogged
Out
ViewMixin
class
RoomAutocomplete
(
Autocomplete
Unl
oggedViewMixin
):
class
RoomAutocomplete
(
Autocomplete
L
ogged
Out
ViewMixin
):
obj_type
=
Room
# Precision on search to add annotations so search behaves more like users expect it to
...
...
users/views_autocomplete.py
View file @
9669ab68
...
...
@@ -33,13 +33,13 @@ from __future__ import unicode_literals
from
.models
import
User
,
School
,
Adherent
,
Club
,
ListShell
from
re2o.views
import
AutocompleteViewMixin
,
Autocomplete
Unl
oggedViewMixin
from
re2o.views
import
AutocompleteViewMixin
,
Autocomplete
L
ogged
Out
ViewMixin
from
django.db.models
import
Q
,
Value
,
CharField
from
django.db.models.functions
import
Concat
class
SchoolAutocomplete
(
Autocomplete
Unl
oggedViewMixin
):
class
SchoolAutocomplete
(
Autocomplete
L
ogged
Out
ViewMixin
):
obj_type
=
School
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment