Skip to content
Snippets Groups Projects
Commit 9fbfac7b authored by Pierre-antoine Comby's avatar Pierre-antoine Comby
Browse files

distinct on field not supported by sqlite

parent 72e5df0c
No related branches found
No related tags found
1 merge request!74distinct on field not supported by sqlite
Pipeline #8113 passed with stages
in 4 minutes and 4 seconds
......@@ -139,7 +139,7 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
| Q(name__regex=pattern)
| Q(normalized_name__regex=Alias.normalize(pattern)))) \
.filter(PermissionBackend.filter_queryset(self.request.user, Alias, "view"))\
.distinct("username")[:20]
.distinct()[:20]
for note in note_qs:
note.type = "Adhérent"
note.activity = activity
......
......@@ -43,7 +43,7 @@ class PermissionBackend(ModelBackend):
rolepermissions__role__membership__date_end__gte=datetime.date.today(),
type=t,
mask__rank__lte=get_current_session().get("permission_mask", 0),
).distinct('club', 'pk',)
).distinct()
@staticmethod
def permissions(user, model, type):
......
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