Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
d77ee3f2
Unverified
Commit
d77ee3f2
authored
6 years ago
by
Eugen Rochko
Committed by
GitHub
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix accounts created through tootctl not being always pre-approved (#10684)
Add `--approve` option to `tootctl accounts modify`
parent
63b1388f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/mastodon/accounts_cli.rb
+6
-1
lib/mastodon/accounts_cli.rb
with
6 additions
and
1 deletion
+6
-1
lib/mastodon/accounts_cli.rb
+
6
-
1
View file @
d77ee3f2
...
...
@@ -73,7 +73,7 @@ module Mastodon
def
create
(
username
)
account
=
Account
.
new
(
username:
username
)
password
=
SecureRandom
.
hex
user
=
User
.
new
(
email:
options
[
:email
],
password:
password
,
agreement:
true
,
admin:
options
[
:role
]
==
'admin'
,
moderator:
options
[
:role
]
==
'moderator'
,
confirmed_at:
options
[
:confirmed
]
?
Time
.
now
.
utc
:
nil
)
user
=
User
.
new
(
email:
options
[
:email
],
password:
password
,
agreement:
true
,
approved:
true
,
admin:
options
[
:role
]
==
'admin'
,
moderator:
options
[
:role
]
==
'moderator'
,
confirmed_at:
options
[
:confirmed
]
?
Time
.
now
.
utc
:
nil
)
if
options
[
:reattach
]
account
=
Account
.
find_local
(
username
)
||
Account
.
new
(
username:
username
)
...
...
@@ -115,6 +115,7 @@ module Mastodon
option
:enable
,
type: :boolean
option
:disable
,
type: :boolean
option
:disable_2fa
,
type: :boolean
option
:approve
,
type: :boolean
desc
'modify USERNAME'
,
'Modify a user'
long_desc
<<-
LONG_DESC
Modify a user account.
...
...
@@ -128,6 +129,9 @@ module Mastodon
With the --disable option, lock the user out of their account. The
--enable option is the opposite.
With the --approve option, the account will be approved, if it was
previously not due to not having open registrations.
With the --disable-2fa option, the two-factor authentication
requirement for the user can be removed.
LONG_DESC
...
...
@@ -147,6 +151,7 @@ module Mastodon
user
.
email
=
options
[
:email
]
if
options
[
:email
]
user
.
disabled
=
false
if
options
[
:enable
]
user
.
disabled
=
true
if
options
[
:disable
]
user
.
approved
=
true
if
options
[
:approve
]
user
.
otp_required_for_login
=
false
if
options
[
:disable_2fa
]
user
.
confirm
if
options
[
:confirm
]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets