Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
aff3f850
Commit
aff3f850
authored
2 years ago
by
Claire
Browse files
Options
Downloads
Patches
Plain Diff
Fix server error when failing to follow back followers from `/relationships` (#23787)
parent
b52746e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/relationships_controller.rb
+2
-0
2 additions, 0 deletions
app/controllers/relationships_controller.rb
app/models/form/account_batch.rb
+6
-0
6 additions, 0 deletions
app/models/form/account_batch.rb
config/locales/en.yml
+1
-0
1 addition, 0 deletions
config/locales/en.yml
with
9 additions
and
0 deletions
app/controllers/relationships_controller.rb
+
2
−
0
View file @
aff3f850
...
...
@@ -19,6 +19,8 @@ class RelationshipsController < ApplicationController
@form
.
save
rescue
ActionController
::
ParameterMissing
# Do nothing
rescue
Mastodon
::
NotPermittedError
,
ActiveRecord
::
RecordNotFound
flash
[
:alert
]
=
I18n
.
t
(
'relationships.follow_failure'
)
if
action_from_button
==
'follow'
ensure
redirect_to
relationships_path
(
filter_params
)
end
...
...
This diff is collapsed.
Click to expand it.
app/models/form/account_batch.rb
+
6
−
0
View file @
aff3f850
...
...
@@ -35,9 +35,15 @@ class Form::AccountBatch
private
def
follow!
error
=
nil
accounts
.
each
do
|
target_account
|
FollowService
.
new
.
call
(
current_account
,
target_account
)
rescue
Mastodon
::
NotPermittedError
,
ActiveRecord
::
RecordNotFound
=>
e
error
||=
e
end
raise
error
if
error
.
present?
end
def
unfollow!
...
...
This diff is collapsed.
Click to expand it.
config/locales/en.yml
+
1
−
0
View file @
aff3f850
...
...
@@ -1399,6 +1399,7 @@ en:
confirm_remove_selected_followers
:
Are you sure you want to remove selected followers?
confirm_remove_selected_follows
:
Are you sure you want to remove selected follows?
dormant
:
Dormant
follow_failure
:
Could not follow some of the selected accounts.
follow_selected_followers
:
Follow selected followers
followers
:
Followers
following
:
Following
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment