Commit c045bb54 authored by Magdalena Frankiewicz's avatar Magdalena Frankiewicz

Remove bio-html and cached_markdown_version from user_details

Stop exposing bio-html in API

Changelog: removed
parent c799e7be
...@@ -4,7 +4,7 @@ class UserDetail < ApplicationRecord ...@@ -4,7 +4,7 @@ class UserDetail < ApplicationRecord
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
include IgnorableColumns include IgnorableColumns
ignore_columns %i[bio_html cached_markdown_version], remove_with: '13.6', remove_after: '2021-10-22' ignore_columns %i[bio_html cached_markdown_version], remove_with: '14.5', remove_after: '2021-10-22'
REGISTRATION_OBJECTIVE_PAIRS = { basics: 0, move_repository: 1, code_storage: 2, exploring: 3, ci: 4, other: 5, joining_team: 6 }.freeze REGISTRATION_OBJECTIVE_PAIRS = { basics: 0, move_repository: 1, code_storage: 2, exploring: 3, ci: 4, other: 5, joining_team: 6 }.freeze
......
# frozen_string_literal: true
class RemoveBioHtmlFromUserDetails < Gitlab::Database::Migration[1.0]
enable_lock_retries!
def change
remove_column :user_details, :bio_html, :text, null: true
remove_column :user_details, :cached_markdown_version, :integer, null: true
end
end
88f8e8391a480450a3d76d98f089e1e2287048007d0ecdcbd0799c9cc021481f
\ No newline at end of file
...@@ -19847,8 +19847,6 @@ CREATE TABLE user_details ( ...@@ -19847,8 +19847,6 @@ CREATE TABLE user_details (
user_id bigint NOT NULL, user_id bigint NOT NULL,
job_title character varying(200) DEFAULT ''::character varying NOT NULL, job_title character varying(200) DEFAULT ''::character varying NOT NULL,
bio character varying(255) DEFAULT ''::character varying NOT NULL, bio character varying(255) DEFAULT ''::character varying NOT NULL,
bio_html text,
cached_markdown_version integer,
webauthn_xid text, webauthn_xid text,
other_role text, other_role text,
provisioned_by_group_id bigint, provisioned_by_group_id bigint,
...@@ -5,7 +5,6 @@ module API ...@@ -5,7 +5,6 @@ module API
class User < UserBasic class User < UserBasic
include UsersHelper include UsersHelper
include TimeZoneHelper include TimeZoneHelper
include ActionView::Helpers::SanitizeHelper
expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) }
expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization, :job_title, :pronouns expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization, :job_title, :pronouns
...@@ -19,13 +18,6 @@ module API ...@@ -19,13 +18,6 @@ module API
expose :following, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } do |user| expose :following, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } do |user|
user.followees.size user.followees.size
end end
# This is only for multi version compatibility reasons, as we removed user.bio_html
# to be removed in 14.4
expose :bio_html do |user|
strip_tags(user.bio)
end
expose :local_time do |user| expose :local_time do |user|
local_time(user.timezone) local_time(user.timezone)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment