Merge pull request #8254 from scinote-eln/hotfix/1.39.1.2

February 2025 Hotfix 2
This commit is contained in:
Martin Artnik 2025-02-18 13:26:53 +01:00 committed by GitHub
commit 28b223a65f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 17 deletions

View file

@ -1 +1 @@
1.39.1.1
1.39.1.2

View file

@ -29,7 +29,7 @@ module Lists
end
def paginate_records
@records = @records.page(@params[:page]).per(@params[:per_page]) if @params[:page].present?
@records = @records.page(@params[:page]).per(@params[:per_page])
end
def sort_direction(order_params)

View file

@ -112,20 +112,6 @@ class UserDataDeletion
end
def self.destroy_notifications(user)
# Find all notifications where user is the only reference
# on the notification, and destroy all such notifications
# (user_notifications are destroyed when notification is
# destroyed). We try to do this efficiently (hence in_groups_of).
nids_all = user.notifications.pluck(:id)
nids_all.in_groups_of(1000, false) do |nids|
Notification
.where(id: nids)
.joins(:user_notifications)
.group('notifications.id')
.having('count(notification_id) <= 1')
.destroy_all
end
# Now, simply destroy all user notification relations left
user.user_notifications.destroy_all
user.notifications.in_batches(of: 1000).destroy_all
end
end

View file

@ -3,6 +3,8 @@
<head>
<title><%= t("protocols.print.title") %></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="<%= global_constants_path(format: :js) %>"></script>
<%= javascript_include_tag 'jquery_bundle' %>
<%= javascript_include_tag 'application' %>
<%= javascript_include_tag "handsontable.full" %>