Skip to content

Commit a174392

Browse files
authored
Merge pull request #151 from AtlasOfLivingAustralia/master
Master to develop
2 parents b54607c + adbd803 commit a174392

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

grails-app/controllers/au/org/ala/alerts/NotificationController.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class NotificationController {
4747
def user = getUser()
4848
try {
4949
notificationService.subscribeMyAnnotation(user)
50-
render([success: true] as JSON)
50+
render ([success: true] as JSON)
5151
} catch (ignored) {
5252
response.sendError(HttpStatus.SC_INTERNAL_SERVER_ERROR, "failed to subscribe to 'my annotation' alert for user " + user?.getUserId())
5353
}
@@ -58,7 +58,7 @@ class NotificationController {
5858
def user = getUser()
5959
try {
6060
notificationService.unsubscribeMyAnnotation(user)
61-
render([success: true] as JSON)
61+
render ([success: true] as JSON)
6262
} catch (ignored) {
6363
response.sendError(HttpStatus.SC_INTERNAL_SERVER_ERROR, "failed to unsubscribe 'my annotation' alert for user " + user?.getUserId())
6464
}

grails-app/controllers/au/org/ala/alerts/UnsubscribeController.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class UnsubscribeController {
4141
if (userAndNotifications.notifications.any { it.query.queryPath == myAnnotationQueryPath }) {
4242
notificationService.unsubscribeMyAnnotation(userAndNotifications.user)
4343
}
44-
4544
render view: "unsubscribed"
4645
}
4746
}

grails-app/controllers/au/org/ala/alerts/WebserviceController.groovy

+5-4
Original file line numberDiff line numberDiff line change
@@ -402,18 +402,19 @@ class WebserviceController {
402402
User user = userService.getUserById(params.userId)
403403
if (user == null) {
404404
response.status = HttpStatus.SC_NOT_FOUND
405-
render([error: "can't find a user with userId " + params.userId] as JSON)
405+
render ([error : "can't find a user with userId " + params.userId] as JSON)
406406
} else {
407407
render(userService.getUserAlertsConfig(user) as JSON)
408408
}
409409
}
410410

411411
@RequireApiKey
412412
def subscribeMyAnnotationWS() {
413-
User user = userService.getUser((String) params.userId)
413+
User user = userService.getUser((String)params.userId)
414414
if (user == null) {
415415
response.status = HttpStatus.SC_NOT_FOUND
416-
render([error: "can't find a user with userId " + params.userId] as JSON)
416+
render ([error : "can't find a user with userId " + params.userId] as JSON)
417+
417418
} else {
418419
try {
419420
notificationService.subscribeMyAnnotation(user)
@@ -429,7 +430,7 @@ class WebserviceController {
429430
User user = userService.getUserById(params.userId)
430431
if (user == null) {
431432
response.status = HttpStatus.SC_NOT_FOUND
432-
render([error: "can't find a user with userId " + params.userId] as JSON)
433+
render ([error : "can't find a user with userId " + params.userId] as JSON)
433434
} else {
434435
try {
435436
notificationService.unsubscribeMyAnnotation(user)

grails-app/services/au/org/ala/alerts/EmailService.groovy

+24-24
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ class EmailService {
8989
def records = retrieveRecordForQuery(query, queryResult)
9090
def totalRecords = queryService.fireWhenNotZeroProperty(queryResult)
9191
[
92-
title : query.name,
93-
message : query.updateMessage,
94-
moreInfo : queryResult.queryUrlUIUsed,
95-
listcode : queryService.isMyAnnotation(query) ? "biocache.view.myannotation.list" : "biocache.view.list",
96-
query : query,
97-
stopNotification: grailsApplication.config.security.cas.appServerName + grailsApplication.config.security.cas.contextPath + '/notification/myAlerts',
98-
frequency : frequency,
99-
records : records,
100-
totalRecords : totalRecords >= 0 ? totalRecords : records.size()
92+
title : query.name,
93+
message : query.updateMessage,
94+
moreInfo : queryResult.queryUrlUIUsed,
95+
listcode : queryService.isMyAnnotation(query) ? "biocache.view.myannotation.list" : "biocache.view.list",
96+
query : query,
97+
stopNotification: grailsApplication.config.security.cas.appServerName + grailsApplication.config.security.cas.contextPath + '/notification/myAlerts',
98+
frequency : frequency,
99+
records : records,
100+
totalRecords : totalRecords >= 0 ? totalRecords : records.size()
101101
]
102102
}
103103

@@ -140,21 +140,21 @@ class EmailService {
140140
subject query.name
141141
bcc subsetOfAddresses
142142
body(view: query.emailTemplate,
143-
plugin: "email-confirmation",
144-
model: [title : localeSubject,
145-
message : query.updateMessage,
146-
query : query,
147-
moreInfo : queryResult.queryUrlUIUsed,
148-
speciesListInfo : speciesListInfo,
149-
userAssertions : userAssertions,
150-
listcode : queryService.isMyAnnotation(query) ? "biocache.view.myannotation.list" : "biocache.view.list",
151-
stopNotification: urlPrefix + '/notification/myAlerts',
152-
records : records,
153-
frequency : messageSource.getMessage('frequency.' + frequency, null, siteLocale),
154-
totalRecords : (totalRecords >= 0 ? totalRecords : records.size()),
155-
unsubscribeAll : urlPrefix + "/unsubscribe?token=" + userUnsubToken,
156-
unsubscribeOne : urlPrefix + "/unsubscribe?token=" + notificationUnsubToken
157-
])
143+
plugin: "email-confirmation",
144+
model: [title: localeSubject,
145+
message: query.updateMessage,
146+
query: query,
147+
moreInfo: queryResult.queryUrlUIUsed,
148+
speciesListInfo: speciesListInfo,
149+
userAssertions: userAssertions,
150+
listcode: queryService.isMyAnnotation(query) ? "biocache.view.myannotation.list" : "biocache.view.list",
151+
stopNotification: urlPrefix + '/notification/myAlerts',
152+
records: records,
153+
frequency: messageSource.getMessage('frequency.' + frequency, null, siteLocale),
154+
totalRecords: (totalRecords >= 0 ? totalRecords : records.size()),
155+
unsubscribeAll: urlPrefix + "/unsubscribe?token=" + userUnsubToken,
156+
unsubscribeOne: urlPrefix + "/unsubscribe?token=" + notificationUnsubToken
157+
])
158158
}
159159
} catch (Exception e) {
160160
log.error("Error sending email to addresses: " + subsetOfAddresses, e)

0 commit comments

Comments
 (0)