= ({
group: false,
header: '/header.png',
header_static: '/header_static.png',
+ header_description: '',
indexable: true,
last_status_at: '2023-01-01',
locked: false,
diff --git a/app/models/collection.rb b/app/models/collection.rb
index 3be633bbf1..c8d4fb99bc 100644
--- a/app/models/collection.rb
+++ b/app/models/collection.rb
@@ -36,11 +36,9 @@ class Collection < ApplicationRecord
validates :name, length: { maximum: 40 }, if: :local?
validates :name, length: { maximum: NAME_LENGTH_HARD_LIMIT }, if: :remote?
validates :description,
- presence: true,
length: { maximum: 100 },
if: :local?
validates :description_html,
- presence: true,
length: { maximum: DESCRIPTION_LENGTH_HARD_LIMIT },
if: :remote?
validates :local, inclusion: [true, false]
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 664d8f88d7..a8c639fe34 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -12,7 +12,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
context_extensions :interaction_policies if Mastodon::Feature.collections_enabled?
- attributes :id, :type, :following, :followers,
+ attributes :id, :webfinger, :type, :following, :followers,
:inbox, :outbox, :featured, :featured_tags,
:preferred_username, :name, :summary,
:url, :manually_approves_followers,
diff --git a/app/serializers/rest/collection_serializer.rb b/app/serializers/rest/collection_serializer.rb
index c3f2b55a84..c668ec37dc 100644
--- a/app/serializers/rest/collection_serializer.rb
+++ b/app/serializers/rest/collection_serializer.rb
@@ -15,6 +15,7 @@ class REST::CollectionSerializer < ActiveModel::Serializer
def description
return object.description if object.local?
+ return if object.description_html.nil?
Sanitize.fragment(object.description_html, Sanitize::Config::MASTODON_STRICT)
end
diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml
index 757ef0a090..f328fd91ac 100644
--- a/app/views/auth/shared/_links.html.haml
+++ b/app/views/auth/shared/_links.html.haml
@@ -6,7 +6,7 @@
%li= link_to_login t('auth.login')
- if controller_name != 'registrations'
- %li= link_to t('auth.register'), available_sign_up_path
+ %li= link_to t('auth.register'), available_sign_up_url
- if controller_name != 'passwords' && controller_name != 'registrations'
%li= link_to t('auth.forgot_password'), new_user_password_path
diff --git a/app/views/email_subscription_mailer/notification.html.haml b/app/views/email_subscription_mailer/notification.html.haml
index ad816ba460..12848c59b3 100644
--- a/app/views/email_subscription_mailer/notification.html.haml
+++ b/app/views/email_subscription_mailer/notification.html.haml
@@ -27,7 +27,7 @@
/[if mso]
|
%div
- = render 'application/mailer/button', text: t('.create_account'), url: available_sign_up_path, has_arrow: false
+ = render 'application/mailer/button', text: t('.create_account'), url: available_sign_up_url, has_arrow: false
/[if mso]
|
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 46dbd80de0..1b95be1d33 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -94,14 +94,14 @@ RSpec.describe ApplicationHelper do
end
end
- describe 'available_sign_up_path' do
+ describe 'available_sign_up_url' do
context 'when registrations are closed' do
before do
allow(Setting).to receive(:[]).with('registrations_mode').and_return 'none'
end
it 'redirects to joinmastodon site' do
- expect(helper.available_sign_up_path).to match(/joinmastodon.org/)
+ expect(helper.available_sign_up_url).to match(/joinmastodon.org/)
end
end
@@ -113,13 +113,13 @@ RSpec.describe ApplicationHelper do
end
it 'redirects to joinmastodon site' do
- expect(helper.available_sign_up_path).to match(/joinmastodon.org/)
+ expect(helper.available_sign_up_url).to match(/joinmastodon.org/)
end
end
context 'when registrations are allowed' do
it 'returns a link to the registration page' do
- expect(helper.available_sign_up_path).to eq(new_user_registration_path)
+ expect(helper.available_sign_up_url).to eq(new_user_registration_url)
end
end
end
diff --git a/spec/models/collection_spec.rb b/spec/models/collection_spec.rb
index 6937829ebb..64e93b6797 100644
--- a/spec/models/collection_spec.rb
+++ b/spec/models/collection_spec.rb
@@ -10,8 +10,6 @@ RSpec.describe Collection do
it { is_expected.to validate_length_of(:name).is_at_most(40) }
- it { is_expected.to validate_presence_of(:description) }
-
it { is_expected.to validate_length_of(:description).is_at_most(100) }
it { is_expected.to_not allow_value(nil).for(:local) }
@@ -29,10 +27,6 @@ RSpec.describe Collection do
it { is_expected.to validate_length_of(:name).is_at_most(Collection::NAME_LENGTH_HARD_LIMIT) }
- it { is_expected.to_not validate_presence_of(:description) }
-
- it { is_expected.to validate_presence_of(:description_html) }
-
it { is_expected.to validate_length_of(:description_html).is_at_most(Collection::DESCRIPTION_LENGTH_HARD_LIMIT) }
it { is_expected.to validate_presence_of(:uri) }
diff --git a/spec/requests/api/v1_alpha/collections_spec.rb b/spec/requests/api/v1_alpha/collections_spec.rb
index a0573342d8..f448659bf5 100644
--- a/spec/requests/api/v1_alpha/collections_spec.rb
+++ b/spec/requests/api/v1_alpha/collections_spec.rb
@@ -180,7 +180,6 @@ RSpec.describe 'Api::V1Alpha::Collections', feature: :collections do
'error' => a_hash_including({
'details' => a_hash_including({
'name' => [{ 'error' => 'ERR_BLANK', 'description' => "can't be blank" }],
- 'description' => [{ 'error' => 'ERR_BLANK', 'description' => "can't be blank" }],
}),
}),
})