From f4358c4d5d3bd04644641b8fd6c74011bc822d93 Mon Sep 17 00:00:00 2001
From: fred-fri <fred-fri@dsv.su.se>
Date: Tue, 29 May 2012 12:31:05 +0900
Subject: [PATCH] changed unit label on supervisor profile to point to the unit
 attribute

---
 .../se/su/dsv/scipro/supervisor/panels/ProfilePanel.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/se/su/dsv/scipro/supervisor/panels/ProfilePanel.java b/src/main/java/se/su/dsv/scipro/supervisor/panels/ProfilePanel.java
index 0d5a45967f..229d751fb3 100644
--- a/src/main/java/se/su/dsv/scipro/supervisor/panels/ProfilePanel.java
+++ b/src/main/java/se/su/dsv/scipro/supervisor/panels/ProfilePanel.java
@@ -89,12 +89,11 @@ public class ProfilePanel extends Panel {
 			};
 			add(languageListView);
 
-			final KeywordType unitType = keywordTypeDao.findByType(KeywordTypeDao.TYPE.UNIT);
-			if (employeeModel.getObject().getKeywords().getFiltered(unitType) == null || employeeModel.getObject().getKeywords().getFiltered(unitType).isEmpty()){
+            if (employeeModel.getObject().getUnit() == null){
 				add(new Label("unitlabel", "You are not registered under any existing/active unit in Daisy. Please make sure you are registered under an existing/active unit in Daisy ASAP."));
 			}
 			else {
-				add(new Label("unitlabel", employeeModel.getObject().getKeywords().getFiltered(unitType).get(0).getKeyword()));
+                add(new Label("unitlabel", employeeModel.getObject().getUnit().getTitle()));
 			}
 
 			final KeywordType areaType = keywordTypeDao.findByType(KeywordTypeDao.TYPE.RESEARCH_AREA);