]> cat aescling's git repositories - mastodon.git/commitdiff
Fix invite request input not being shown on sign-up error if left empty (#13089)
authorThibG <thib@sitedethib.com>
Sun, 16 Feb 2020 11:38:22 +0000 (12:38 +0100)
committerGitHub <noreply@github.com>
Sun, 16 Feb 2020 11:38:22 +0000 (12:38 +0100)
If the “Why do you want to join?” textarea is left empty and the entered params
do not validate, the textarea isn't shown again, unlike other fields.

This commit fixes that by populating an empty `UserInviteRequest` when needed.

app/views/auth/registrations/new.html.haml

index e807c8d86764e31dcf3e118699c7488df843e755..bcd66fb8a00ef6126a67bf8d6720413586a5756d 100644 (file)
@@ -27,7 +27,7 @@
 
   - if approved_registrations? && !@invite.present?
     .fields-group
-      = f.simple_fields_for :invite_request do |invite_request_fields|
+      = 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
 
   = f.input :invite_code, as: :hidden