diff --git a/templates/other/accounts.php.tt2 b/templates/other/accounts.php.tt2
index 04acc33cf498cfe194a9c0bd4872b9a103b4bba2..2baf9e1bfd31d62ec38849a9aa3ec0dcbd9a0efc 100644
--- a/templates/other/accounts.php.tt2
+++ b/templates/other/accounts.php.tt2
@@ -9,9 +9,8 @@ $validTestAccounts = array (
     '[% account.internal_uid() %]:{SHA256}[% account.password_hash() %]=' => array(
         'internal_uid' => array([% account.internal_uid().quote %]),
         'associatedSP' => array([% account.entityid().quote %]),
-    [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %]
-	[% NEXT UNLESS  attributes.$attribute %]
-        '[% attribute %]' => array([% attributes.$attribute.quote("'").join(', ') %]),
+    [% FOREACH pair IN attributes.pairs %]
+        '[% pair.key %]' => array([% pair.value.quote("'").join(', ') %]),
     [% END %]
     ),
 
diff --git a/templates/web/renater/create_accounts.tt2.html b/templates/web/renater/create_accounts.tt2.html
index 307e4f52324a34edf43061eb35035e98a0d0bcc3..f139c28e83e584211202624845a070215faa347d 100644
--- a/templates/web/renater/create_accounts.tt2.html
+++ b/templates/web/renater/create_accounts.tt2.html
@@ -58,9 +58,9 @@
         <div>
             <table>
                 <caption>[% lh.maketext("List of user attributes") %]</caption>
-    [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %]
+    [% FOREACH pair IN attributes.pairs %]
                 <tr>
-                    <th>[% attribute %]</th><td>[% attributes.$attribute.join(', ') %]</td>
+                    <th>[% pair.key %]</th><td>[% pair.value.join(', ') %]</td>
                 </tr>
     [% END %]
                 <tr>