-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make the invite request field mandatory #15273
Comments
look here |
Thank you for the link but it's not work. With this diff : diff --git a/app/views/about/_registration.html.haml b/app/views/about/_registration.html.haml
index af28e2174..8f313e143 100644
--- a/app/views/about/_registration.html.haml
+++ b/app/views/about/_registration.html.haml
@@ -13,7 +13,7 @@
- if approved_registrations?
.fields-group
= f.simple_fields_for :invite_request do |invite_request_fields|
- = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: false
+ = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: true
.fields-group
= f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: closed_registrations?
diff --git a/app/views/auth/registrations/new.html.haml b/app/views/auth/registrations/new.html.haml
index 457bc1d23..4ff972096 100644
--- a/app/views/auth/registrations/new.html.haml
+++ b/app/views/auth/registrations/new.html.haml
@@ -28,7 +28,7 @@
- if approved_registrations? && !@invite.present?
.fields-group
= f.simple_fields_for :invite_request, resource.invite_request || resource.build_invite_request do |invite_request_fields|
- = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: false
+ = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: true
= f.input :invite_code, as: :hidden The field is still not required to validate the registration. In the HTML the field is marked as required but not block if empty |
This is something I had planned on working on today, I will do so. @mashirozx's suggestion seems mostly correct to me, except it won't enforce the verification on the backend. Did you restart mastodon-web? |
I recompute the assets (the * for required field is good), and I restart these services : I don't know what is missing. |
Seems there is no request field here: Shall we add logic of pending account with a invite link? (I think this is a bit unreasonal) |
@c-chell oh, if you're applying this change on top of v3.2.1, you also need to add |
uhhh, I'm misunderstanding (・・;) |
Thank you, now the field is required in the browser; but not on the server, I test it with using the inspector of the browser and if I remove manually the require attribute of the field the account is created. |
Thank you @ThibG for your code, I copy it on my custom branch and it's seems to work great. |
The issue will automatically be closed when (if) the PR gets merged |
Fixes #15273 Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Hello,
On my instance, I activate the manual approval mode for accounts.
Now I'm dealing with high amount of accounts created without the invite field (Why do you want to join?) completed.
I want to make this field mandatory/required.
(after more than hour of search)
I try to edit the file /app/views/auth/registrations/new.html.haml to change to
= invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: true
(I also run the commands RAILS_ENV=production bundle exec rails assets:precompile and restart mastodon processes after that)
But the field is not required and I can create a test account without this field.
How to make this field mandatory ?
(version 3.2.1)
Thank you.
The text was updated successfully, but these errors were encountered: