FIX: show required only when full name is required and lint fix (#12916)

FIX: show required only when full name is required and lint fix (#12916)

diff --git a/app/assets/javascripts/discourse/app/templates/invites/show.hbs b/app/assets/javascripts/discourse/app/templates/invites/show.hbs
index 9a45776..a38a711 100644
--- a/app/assets/javascripts/discourse/app/templates/invites/show.hbs
+++ b/app/assets/javascripts/discourse/app/templates/invites/show.hbs
@@ -74,7 +74,9 @@
               <div class="input name-input">
                 <label for="new-account-name">
                   {{i18n "invites.name_label"}}
-                  <span class="required">*</span>
+                  {{#if siteSettings.full_name_required}}
+                    <span class="required">*</span>
+                  {{/if}}
                 </label>
                 {{input value=accountName id="new-account-name" name="name"}}
                 <div class="instructions">{{nameInstructions}}</div>
diff --git a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js
index bba5f57..73ec2d4 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js
@@ -147,6 +147,12 @@ acceptance("Invite accept", function (needs) {
       "submit is enabled"
     );
   });
+
+  test("invite name is required only if full name is required", async function (assert) {
+    preloadInvite();
+    await visit("/invites/myvalidinvitetoken");
+    assert.ok(exists(".name-input .required"), "Full name is required");
+  });
 });
 
 acceptance("Invite accept when local login is disabled", function (needs) {

GitHub sha: 0ac9abe5

This commit appears in #12916 which was approved by eviltrout. It was merged by SamSaffron.