Skip to content

Commit 181d365

Browse files
authored
[RELEASE] Pod 4.0.1
[RELEASE] Pod 4.0.1 * Fix some bugs (Aristote notify, Live truncate chars, Recorder max_length to 200, Migrate BBB recordings, Search: Display the right number of results) * Bump Django to 4.2.24 to prevent SQL injection in FilteredRelation with column aliases * Bump djangorestframework-simplejwt from 5.3.1 to 5.5.1
2 parents c10002e + 827e788 commit 181d365

File tree

9 files changed

+29
-28
lines changed

9 files changed

+29
-28
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Before sending your pull request, make sure the following are done
22

33
* [ ] You have read our [contribution guidelines](https://github.com/EsupPortail/Esup-Pod/blob/master/CONTRIBUTING.md).
4-
* [ ] Your PR targets the `main` branch.
4+
* [ ] Your PR targets the `dev_v4` branch.
55
* [ ] Your PR status is in `draft` if it's still a work in progress.

pod/ai_enhancement/utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
import requests
66
import logging
77
from django.conf import settings
8-
from requests import Response
8+
from django.core.mail import EmailMultiAlternatives
9+
from django.core.mail import mail_managers
10+
from django.core.mail import send_mail
911
from django.urls import reverse
1012
from django.utils.translation import gettext_lazy as _
1113
from pod.ai_enhancement.models import AIEnhancement
1214
from pod.main.utils import extract_json_from_str
15+
from pod.progressive_web_app.utils import notify_user as pwa_notify_user
1316
from pod.video.models import Discipline, Video
17+
from requests import Response
1418
from webpush.models import PushInformation
15-
from django.core.mail import send_mail
16-
from django.core.mail import mail_managers
17-
from django.core.mail import EmailMultiAlternatives
1819

1920
DEBUG = getattr(settings, "DEBUG", True)
2021
DEFAULT_FROM_EMAIL = getattr(settings, "DEFAULT_FROM_EMAIL", "[email protected]")
@@ -279,7 +280,7 @@ def send_notification_enhancement(video):
279280
"site_title": __TITLE_SITE__,
280281
}
281282

282-
notify_user(
283+
pwa_notify_user(
283284
video.owner,
284285
subject,
285286
message,

pod/live/templates/live/event_card.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
<a href="{{event.get_absolute_url}}
5858
{% if playlist %}?playlist={{playlist.slug}}{% endif %}"
5959
title="{% blocktrans with title=event.title %}See the event “{{ title }}”.{% endblocktrans %}">
60-
{{event.title|capfirst|truncatechars:70}}
60+
{{event.title|capfirst|truncatechars:55}}
6161
</a>
6262
</br>
6363
{% if event.start_date|date:"d/m/Y" == event.end_date|date:"d/m/Y" %}
64-
{% blocktrans with start_date=event.start_date|date:"d/m/Y" start_time=event.start_date|time:"H:i" end_time=event.end_date|time:"H:i" %}The {{start_date}} from {{start_time}} to {{end_time}}{% endblocktrans %}
64+
{% blocktrans with start_date=event.start_date|date:"d/m/y" start_time=event.start_date|time:"H:i" end_time=event.end_date|time:"H:i" %}The {{start_date}} from {{start_time}} to {{end_time}}{% endblocktrans %}
6565
{% else %}
66-
{% blocktrans with start_date=event.start_date|date:"d/m/Y" end_date=event.end_date|date:"d/m/Y" %}from {{start_date}} to {{end_date}}{% endblocktrans %}
66+
{% blocktrans with start_date=event.start_date|date:"d/m/y" end_date=event.end_date|date:"d/m/y" %}from {{start_date}} to {{end_date}}{% endblocktrans %}
6767
{% endif %}
6868
{% if display_broadcaster_name %}
6969
<br>{{event.broadcaster.name|capfirst|truncatechars:20}}

pod/recorder/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ class RecordingFileTreatment(models.Model):
387387
recursive=True,
388388
unique=True,
389389
help_text=_("Source file of the published video."),
390+
max_length=200
390391
)
391392
file_size = models.BigIntegerField(_("File size"), default=0)
392393
recorder = models.ForeignKey(

pod/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
##
2020
# Version of the project
2121
#
22-
VERSION = "4.0.0"
22+
VERSION = "4.0.1"
2323

2424
##
2525
# Installed applications list

pod/video/management/commands/migrate_bbb_recordings.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
Typically, when moving from a local architecture to the
55
French Ministry of Higher Education and Research (ESR) BBB architecture.
66
7-
More information on this module at: https://www.esup-portail.org/wiki/x/C4CFUQ
7+
This script can also be used to backup BBB recordings. For example, in the case of a
8+
backup of the BBB records of the ESR infrastructure, as they are only kept for one year.
9+
10+
More information on this module at: https://esupportail.github.io/Esup-Pod/4.x/Installation/optional/bbb-infrastructure-migration-install_fr
811
912
Reminder of constraints:
1013
- no use of Pod's old BBB module (this module will be phased out in the near future)
@@ -99,7 +102,6 @@
99102
from django.core.management.base import BaseCommand
100103
from django.template.defaultfilters import slugify
101104
from pod.import_video.utils import manage_download, parse_remote_file
102-
from pod.import_video.utils import manage_recording_url, check_url_exists
103105
from pod.import_video.models import ExternalRecording
104106
from pod.import_video.views import start_bbb_encode_presentation_and_move_to_destination
105107
from pod.meeting.models import Meeting
@@ -110,8 +112,6 @@
110112
# Moodle database engine (postgresql, mysql or None)
111113
MOODLE_DB_TYPE = None
112114

113-
MOODLE_DB_TYPE = "postgresql"
114-
115115
if MOODLE_DB_TYPE == "postgresql":
116116
# For PostgreSQL database #
117117
# Don't forget to run the following command the 1st time
@@ -487,7 +487,7 @@ def get_recording(recording) -> Generic_recording:
487487
# Not other format like "screenshare" or "podcast"
488488

489489
# Check playback data
490-
presentation_url, video_url = get_recording_urls()
490+
presentation_url, video_url = get_recording_urls(recording, internal_meeting_id)
491491

492492
# Define the result with the Generic_recording class
493493
generic_recording = Generic_recording(
@@ -556,13 +556,13 @@ def download_bbb_video_file(source_url: str, dest_file: str) -> None:
556556
session = requests.Session()
557557
# Download and parse the remote HTML file (BBB specific)
558558
video_file_add = parse_remote_file(session, source_url)
559-
# Verify that video exists
560-
source_video_url = manage_recording_url(source_url, video_file_add)
561-
if check_url_exists(source_video_url):
559+
try:
562560
# Download the video file
563561
source_video_url = manage_download(session, source_url, video_file_add, dest_file)
564-
else:
565-
print("Unable to download %s: video file doesn't exist." % source_url)
562+
print(" > Video %s downloaded." % source_video_url)
563+
except Exception as e:
564+
err = ("Unable to download %s: %s. %s " % (source_url, str(e), traceback.format_exc()))
565+
print(err)
566566

567567

568568
def process_recording_to_claim(options, generic_recording) -> None:

pod/video/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def paginator(videos_list, page):
358358
def channel(request, slug_c, slug_t=None):
359359
channel = get_object_or_404(Channel, slug=slug_c, site=get_current_site(request))
360360
videos_list = get_available_videos().filter(channel=channel)
361-
videos_list = sort_videos_list(videos_list, "date_added", "on")
361+
videos_list = sort_videos_list(videos_list, "date_added")
362362
channel.video_count = videos_list.count()
363363

364364
theme = None

pod/video_search/views.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ def search_videos(request):
212212

213213
# add cursus and main_lang 'cursus', 'main_lang',
214214
bodysearch["aggs"]["cursus"] = {
215-
"terms": {"field": "cursus", "size": 5, "order": {"_count": "desc"}}
215+
"terms": {"field": "cursus.keyword", "size": 5, "order": {"_count": "desc"}}
216216
}
217217
bodysearch["aggs"]["main_lang"] = {
218-
"terms": {"field": "main_lang", "size": 5, "order": {"_count": "desc"}}
218+
"terms": {"field": "main_lang.keyword", "size": 5, "order": {"_count": "desc"}}
219219
}
220220

221221
# if settings.DEBUG:
@@ -239,9 +239,8 @@ def search_videos(request):
239239
videos = Video.objects.filter(id__in=list_videos_id)
240240
num_result = 0
241241
# In case of desynchronization with Elasticsearch, this result could be false.
242-
# num_result = result["hits"]["total"]["value"]
243-
# With this code, the result is always correct
244-
num_result = len(videos)
242+
# So, don't forget to reindex if necessary
243+
num_result = result["hits"]["total"]["value"]
245244
videos.has_next = ((page + 1) * size) < num_result
246245
videos.next_page_number = page + 1
247246

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ qrcode
2828
ralph-malph==5.0.1
2929
pydantic==2.10.2
3030
bleach==6.2.0
31-
pytubefix==8.12.0
31+
pytubefix==9.4.1
3232
django-redis-sessions
3333
paramiko~=3.5.0
34-
djangorestframework-simplejwt==5.3.1
34+
djangorestframework-simplejwt==5.5.1
3535
django-pwa==2.0.1
3636
django-webpush==0.3.6
3737
defusedxml==0.7.1

0 commit comments

Comments
 (0)