8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Unlogged->LoggedOut

This commit is contained in:
chirac 2021-01-02 23:42:13 +01:00
parent dceaf9d60f
commit 6f76201da2
3 changed files with 6 additions and 6 deletions

View file

@ -173,7 +173,7 @@ def handler404(request):
return render(request, "errors/404.html", status=404)
class AutocompleteUnloggedViewMixin(autocomplete.Select2QuerySetView):
class AutocompleteLoggedOutViewMixin(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, AutocompleteUnloggedViewMixin):
class AutocompleteViewMixin(LoginRequiredMixin, AutocompleteLoggedOutViewMixin):
pass

View file

@ -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, AutocompleteUnloggedViewMixin
from re2o.views import AutocompleteViewMixin, AutocompleteLoggedOutViewMixin
class RoomAutocomplete(AutocompleteUnloggedViewMixin):
class RoomAutocomplete(AutocompleteLoggedOutViewMixin):
obj_type = Room
# Precision on search to add annotations so search behaves more like users expect it to

View file

@ -33,13 +33,13 @@ from __future__ import unicode_literals
from .models import User, School, Adherent, Club, ListShell
from re2o.views import AutocompleteViewMixin, AutocompleteUnloggedViewMixin
from re2o.views import AutocompleteViewMixin, AutocompleteLoggedOutViewMixin
from django.db.models import Q, Value, CharField
from django.db.models.functions import Concat
class SchoolAutocomplete(AutocompleteUnloggedViewMixin):
class SchoolAutocomplete(AutocompleteLoggedOutViewMixin):
obj_type = School