Avoid suggesting blacklisted emails as university domains.

This commit is contained in:
Paulo Reis 2018-06-26 16:50:55 +01:00
parent 76d8ab11e5
commit 3e0ad47873
2 changed files with 2 additions and 3 deletions

View file

@ -26,7 +26,6 @@ define [
$scope.ui.showManualUniversitySelectionUI = false
if userInputLocalAndDomain.domain?
$scope.ui.isBlacklistedEmail = UserAffiliationsDataService.isDomainBlacklisted userInputLocalAndDomain.domain
UserAffiliationsDataService.getUniversityDomainFromPartialDomainInput(userInputLocalAndDomain.domain)
.then (universityDomain) ->
currentUserInputLocalAndDomain = _matchLocalAndDomain $scope.newAffiliation.email
@ -44,7 +43,7 @@ define [
else
$scope.newAffiliation.university = null
$scope.newAffiliation.department = null
$q.resolve null
$q.reject null
$scope.handleEmailInputBlur = () ->
# if $scope.newAffiliation.autoDetectMode and !$scope.newAffiliation.university and $scope.newAffiliation.email?.match EMAIL_REGEX

View file

@ -39,7 +39,7 @@ define [
$http.get "/institutions/domains" , { params: { hostname: partialDomainInput, limit: 1 } }
.then (response) ->
university = response.data[0]
if university?
if university? and !isDomainBlacklisted university.hostname
universitiesByDomain[university.hostname] = university
$q.resolve university
else