mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-21 21:53:30 +00:00
fix picture navigation
This commit is contained in:
parent
d1cbb765c0
commit
3ef38fabdb
@ -181,7 +181,9 @@ class PictureView(CanViewMixin, DetailView, FormMixin):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs = super().get_context_data(**kwargs)
|
||||
pictures_qs = Picture.objects.viewable_by(self.request.user)
|
||||
pictures_qs = Picture.objects.filter(
|
||||
parent_id=self.object.parent_id
|
||||
).viewable_by(self.request.user)
|
||||
kwargs["form"] = self.form
|
||||
kwargs["next_pict"] = (
|
||||
pictures_qs.filter(id__gt=self.object.id).order_by("id").first()
|
||||
|
Loading…
Reference in New Issue
Block a user