Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
226afe8a2f [UPDATE] Update pytest-cov requirement
Updates the requirements on [pytest-cov](https://github.com/pytest-dev/pytest-cov) to permit the latest version.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.0.0...v7.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-version: 7.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 08:56:11 +00:00
4 changed files with 3 additions and 29 deletions

View File

@@ -74,7 +74,7 @@ dev = [
tests = [
"freezegun<2.0.0,>=1.5.1",
"pytest<9.0.0,>=8.3.5",
"pytest-cov<7.0.0,>=6.0.0",
"pytest-cov>=6.0.0,<8.0.0",
"pytest-django<5.0.0,>=4.10.0",
"model-bakery<2.0.0,>=1.20.4",
"beautifulsoup4>=4.13.3,<5",

View File

@@ -7,7 +7,6 @@ import {
interface PagePictureConfig {
userId: number;
lastPhotoDate?: string;
}
interface Album {
@@ -21,28 +20,11 @@ document.addEventListener("alpine:init", () => {
loading: true,
albums: [] as Album[],
async fetchPictures(): Promise<PictureSchema[]> {
const localStorageKey = `user${config.userId}Pictures`;
const localStorageDateKey = `user${config.userId}PicturesDate`;
const lastCachedDate = localStorage.getItem(localStorageDateKey);
if (
config.lastPhotoDate !== undefined &&
lastCachedDate !== undefined &&
lastCachedDate >= config.lastPhotoDate
) {
return JSON.parse(localStorage.getItem(localStorageKey));
}
async init() {
const pictures = await paginated(picturesFetchPictures, {
// biome-ignore lint/style/useNamingConvention: from python api
query: { users_identified: [config.userId] },
} as PicturesFetchPicturesData);
localStorage.setItem(localStorageDateKey, config.lastPhotoDate);
localStorage.setItem(localStorageKey, JSON.stringify(pictures));
return pictures;
},
async init() {
const pictures = await this.fetchPictures();
const groupedAlbums = Object.groupBy(pictures, (i: PictureSchema) => i.album.id);
this.albums = Object.values(groupedAlbums).map((pictures: PictureSchema[]) => {
return {

View File

@@ -15,7 +15,7 @@
{% endblock %}
{% block content %}
<main x-data="user_pictures({ userId: {{ object.id }}, lastPhotoDate: '{{ object.last_photo_date }}' })">
<main x-data="user_pictures({ userId: {{ object.id }} })">
{% if user.id == object.id %}
{{ download_button(_("Download all my pictures")) }}
{% endif %}

View File

@@ -16,7 +16,6 @@ from typing import Any
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db.models import OuterRef, Subquery
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse
@@ -179,13 +178,6 @@ class UserPicturesView(UserTabsMixin, CanViewMixin, DetailView):
context_object_name = "profile"
template_name = "sas/user_pictures.jinja"
current_tab = "pictures"
queryset = User.objects.annotate(
last_photo_date=Subquery(
Picture.objects.filter(people__user=OuterRef("id"))
.order_by("-date")
.values("date")[:1]
)
).all()
# Admin views