Skip to content

Commit cb265e8

Browse files
committed
TD-4469 Removes GUID email addresses from export
1 parent 81743f4 commit cb265e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DigitalLearningSolutions.Data/DataServices/ActivityDataService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int currentRun
143143
c.CustomisationName,
144144
u.FirstName,
145145
u.LastName,
146-
u.PrimaryEmail,
146+
CASE WHEN COALESCE(ucd.Email, u.PrimaryEmail) LIKE '%@%' THEN COALESCE(ucd.Email, u.PrimaryEmail) ELSE '' END AS EmailAddress,
147147
da.CandidateNumber AS DelegateId,
148148
da.Answer1,
149149
da.Answer2,
@@ -158,7 +158,8 @@ FROM Applications AS a INNER JOIN
158158
tActivityLog AS al ON a.ApplicationID = al.ApplicationID INNER JOIN
159159
Users AS u INNER JOIN
160160
DelegateAccounts AS da ON u.ID = da.UserID ON al.CandidateID = da.ID AND al.CentreID = da.CentreID INNER JOIN
161-
Customisations AS c ON al.CustomisationID = c.CustomisationID
161+
Customisations AS c ON al.CustomisationID = c.CustomisationID LEFT OUTER JOIN
162+
UserCentreDetails AS ucd ON u.ID = ucd.UserID AND c.CentreID = al.CentreID
162163
WHERE (al.LogDate >= @startDate) AND (@endDate IS NULL OR
163164
al.LogDate <= @endDate) AND (al.CentreID = @centreId) AND (@jobGroupId IS NULL OR
164165
al.JobGroupID = @jobGroupId) AND (@customisationId IS NULL OR

0 commit comments

Comments
 (0)