From 1c2dceeb6a2a8821434c592b39316c6a20d76d4c Mon Sep 17 00:00:00 2001
From: sandeepsajan0 <sandeepsajan0@gmail.com>
Date: Wed, 28 Sep 2022 18:26:49 +0530
Subject: [PATCH] Use SingleIncludeBlock's static field name from label if
 exist

---
 hypha/apply/funds/blocks.py | 1 +
 hypha/apply/utils/blocks.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/hypha/apply/funds/blocks.py b/hypha/apply/funds/blocks.py
index 09f0dd3c0..bef534064 100644
--- a/hypha/apply/funds/blocks.py
+++ b/hypha/apply/funds/blocks.py
@@ -104,6 +104,7 @@ class FullNameBlock(ApplicationMustIncludeFieldBlock):
                                  default=_("We will use this name when we communicate with you about your proposal."))
 
     class Meta:
+        label = _('Full name')
         icon = 'user'
 
 
diff --git a/hypha/apply/utils/blocks.py b/hypha/apply/utils/blocks.py
index e59d2e992..1ff00f833 100644
--- a/hypha/apply/utils/blocks.py
+++ b/hypha/apply/utils/blocks.py
@@ -189,7 +189,7 @@ class SingleIncludeStatic(StaticBlock):
 
 class SingleIncludeMixin:
     def __init__(self, *args, **kwargs):
-        info_name = f'{self.name.title()} Field'
+        info_name = f'{self._meta_class.label} Field' if self._meta_class.label else f'{self.name.title()} Field'
         child_blocks = [('info', SingleIncludeStatic(label=info_name, description=self.description))]
         super().__init__(child_blocks, *args, **kwargs)
 
-- 
GitLab