diff --git a/app/models/project.rb b/app/models/project.rb index 52b729a85..02844c3bc 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -451,7 +451,7 @@ class Project < ApplicationRecord Jbuilder.new do |project| project.id self.id project.identifier self.identifier - project.name self.name.to_s.each_char.select { |c| c.bytes.first < 240 }.join('') + project.name self.name project.description Nokogiri::HTML(self.description).text project.visits self.visits project.praises_count self.praises_count.to_i @@ -475,7 +475,7 @@ class Project < ApplicationRecord project.image_url render_educoder_avatar_url(self.project_educoder) else user = self.owner - project.name user.try(:show_real_name).to_s.each_char.select { |c| c.bytes.first < 240 }.join('') + project.name user.try(:show_real_name) project.type user&.type project.login user.login project.image_url user.get_letter_avatar_url diff --git a/app/models/user.rb b/app/models/user.rb index 874da712a..70de1fc64 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -862,7 +862,7 @@ class User < Owner def to_builder Jbuilder.new do |user| user.(self, :id, :login) - user.name self.real_name.to_s.each_char.select { |c| c.bytes.first < 240 }.join('') + user.name self.real_name user.email self.mail user.image_url self.get_letter_avatar_url end diff --git a/db/migrate/20230413121129_change_webhook_task_field_character.rb b/db/migrate/20230413121129_change_webhook_task_field_character.rb new file mode 100644 index 000000000..04c86716d --- /dev/null +++ b/db/migrate/20230413121129_change_webhook_task_field_character.rb @@ -0,0 +1,7 @@ +class ChangeWebhookTaskFieldCharacter < ActiveRecord::Migration[5.2] + def change + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `payload_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `request_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `response_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + end +end