Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🚸(backend) display recording owners directly in admin list view

lebaudantoine409e403581cc
diff --git a/src/backend/core/admin.py b/src/backend/core/admin.py
index 41766f31..d16e90ad 100644
--- a/src/backend/core/admin.py
+++ b/src/backend/core/admin.py
@@ -126,6 +126,27 @@ class RecordingAdmin(admin.ModelAdmin):
inlines = (RecordingAccessInline,)
search_fields = ["status", "=id", "worker_id", "room__slug", "=room__id"]
- list_display = ("id", "status", "room", "created_at", "worker_id")
+ list_display = ("id", "status", "room", "get_owner", "created_at", "worker_id")
list_filter = ["status", "room", "created_at"]
readonly_fields = ["id", "created_at", "updated_at"]
+
+ def get_queryset(self, request):
+ """Optimize queries by prefetching related access and user data to avoid N+1 queries."""
+ return super().get_queryset(request).prefetch_related("accesses__user")
+
+ def get_owner(self, obj):
+ """Return the owner of the recording for display in the admin list."""
+
+ owners = [
+ access
+ for access in obj.accesses.all()
+ if access.role == models.RoleChoices.OWNER
+ ]
+
+ if not owners:
+ return _("No owner")
+
+ if len(owners) > 1:
+ return _("Multiple owners")
+
+ return str(owners[0].user)
diff --git a/src/backend/locale/de_DE/LC_MESSAGES/django.mo b/src/backend/locale/de_DE/LC_MESSAGES/django.mo
index 81077ee3..b20837ff 100644
Binary files a/src/backend/locale/de_DE/LC_MESSAGES/django.mo and b/src/backend/locale/de_DE/LC_MESSAGES/django.mo differ
diff --git a/src/backend/locale/de_DE/LC_MESSAGES/django.po b/src/backend/locale/de_DE/LC_MESSAGES/django.po
index c6f0935b..43107c9e 100644
--- a/src/backend/locale/de_DE/LC_MESSAGES/django.po
+++ b/src/backend/locale/de_DE/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-05-16 17:04+0000\n"
+"POT-Creation-Date: 2025-05-26 10:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -29,6 +29,14 @@ msgstr "Berechtigungen"
msgid "Important dates"
msgstr "Wichtige Daten"
+#: core/admin.py:143
+msgid "No owner"
+msgstr "Kein Eigentümer"
+
+#: core/admin.py:146
+msgid "Multiple owners"
+msgstr "Mehrere Eigentümer"
+
#: core/api/serializers.py:63
msgid "You must be administrator or owner of a room to add accesses to it."
msgstr ""
diff --git a/src/backend/locale/en_US/LC_MESSAGES/django.mo b/src/backend/locale/en_US/LC_MESSAGES/django.mo
index 4e347077..ca4b9d86 100644
Binary files a/src/backend/locale/en_US/LC_MESSAGES/django.mo and b/src/backend/locale/en_US/LC_MESSAGES/django.mo differ
diff --git a/src/backend/locale/en_US/LC_MESSAGES/django.po b/src/backend/locale/en_US/LC_MESSAGES/django.po
index d549a1ab..21cf988a 100644
--- a/src/backend/locale/en_US/LC_MESSAGES/django.po
+++ b/src/backend/locale/en_US/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-05-16 17:04+0000\n"
+"POT-Creation-Date: 2025-05-26 10:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -29,6 +29,14 @@ msgstr "Permissions"
msgid "Important dates"
msgstr "Important dates"
+#: core/admin.py:143
+msgid "No owner"
+msgstr "No owner"
+
+#: core/admin.py:146
+msgid "Multiple owners"
+msgstr "Multiple owners"
+
#: core/api/serializers.py:63
msgid "You must be administrator or owner of a room to add accesses to it."
msgstr "You must be administrator or owner of a room to add accesses to it."
diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo
index 914c83ef..cb8e995c 100644
Binary files a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo and b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo differ
diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.po b/src/backend/locale/fr_FR/LC_MESSAGES/django.po
index c7e11cf0..c2f443ae 100644
--- a/src/backend/locale/fr_FR/LC_MESSAGES/django.po
+++ b/src/backend/locale/fr_FR/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-05-16 17:04+0000\n"
+"POT-Creation-Date: 2025-05-26 10:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: [email protected]\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -29,6 +29,14 @@ msgstr "Permissions"
msgid "Important dates"
msgstr "Dates importantes"
+#: core/admin.py:143
+msgid "No owner"
+msgstr "Pas de propriétaire"
+
+#: core/admin.py:146
+msgid "Multiple owners"
+msgstr "Plusieurs propriétaires"
+
#: core/api/serializers.py:63
msgid "You must be administrator or owner of a room to add accesses to it."
msgstr ""
diff --git a/src/backend/locale/nl_NL/LC_MESSAGES/django.mo b/src/backend/locale/nl_NL/LC_MESSAGES/django.mo
index f8ed350a..900312f0 100644
Binary files a/src/backend/locale/nl_NL/LC_MESSAGES/django.mo and b/src/backend/locale/nl_NL/LC_MESSAGES/django.mo differ
diff --git a/src/backend/locale/nl_NL/LC_MESSAGES/django.po b/src/backend/locale/nl_NL/LC_MESSAGES/django.po
index ddcfd676..3bcd5b5e 100644
--- a/src/backend/locale/nl_NL/LC_MESSAGES/django.po
+++ b/src/backend/locale/nl_NL/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-05-16 17:04+0000\n"
+"POT-Creation-Date: 2025-05-26 10:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -29,6 +29,14 @@ msgstr "Rechten"
msgid "Important dates"
msgstr "Belangrijke datums"
+#: core/admin.py:143
+msgid "No owner"
+msgstr "Geen eigenaar"
+
+#: core/admin.py:146
+msgid "Multiple owners"
+msgstr "Meerdere eigenaren"
+
#: core/api/serializers.py:63
msgid "You must be administrator or owner of a room to add accesses to it."
msgstr ""