def _getEmailErrorMessage(self, response): if response.isEmailRestrictedByCountry: message = errors.emailRestrictedByCountry() elif response.isEmailBannedInCountry: message = loc(rAccCompletion.emailProviderBanned()) elif response.isEmailInvalid: message = errors.emailIsInvalid() elif response.isEmailForbidden: message = loc(rAccCompletion.emailForbidden()) elif response.isEmailMinLength: message = errors.emailIsTooShort() elif response.isEmailMaxLength: message = errors.emailIsTooLong() elif response.isEmailAlreadyTaken: message = errors.emailAlreadyTaken() else: message = super(SteamAddEmailOverlayView, self)._getEmailErrorMessage(response) return message
def createToolTipContent(self, event, contentID): if contentID == R.views.common.tooltip_window.backport_tooltip_content.BackportTooltipContent( ): tooltipId = event.getArgument('tooltipId') if tooltipId == TooltipConstants.SUBTITLE: return SimpleTooltipContent( R.views.common.tooltip_window.simple_tooltip_content. SimpleTooltipContent(), body=loc(R.strings.tooltips.accountCompletion.email. titleTooltip())) return super(SteamAddEmailOverlayView, self).createToolTipContent(event, contentID)
def _handleError(self, response): if response.isConfirmationCodeExpired: self._updateErrorModel(errorMessage=res.activate.keyDied(), buttonTimer=0) elif response.isConfirmationCodeDeactivated: self._updateErrorModel(errorMessage=errors.tooManyIncorrectTriesResID(), buttonTimer=0) elif response.isEmailAlreadyTaken: self._updateErrorModel(errorMessage=res.emailAlreadyTaken(), buttonTimer=0) elif response.isAccountAlreadyHasEmail: showAccountAlreadyHasEmail(self.viewModel) elif response.isConfirmationCodeIncorrect: self._updateErrorModel(errorMessage=errors.keyErrorResID()) else: self._setWarning(loc(res.warningServerUnavailable()))
def _handleError(self, response): if response.isRequestLimitExceeded: with self.viewModel.transaction() as model: message = loc( rAccCompletion.emailOverlay.error.codeAlreadySent()) errorTime = max( RESTRICTED_REQUEST_MIN_TIME, getTimeDeltaFromNow(response.requestRestrictedUntilTime)) model.email.setErrorMessage(message) model.email.setErrorTime(errorTime) elif response.isAccountAlreadyHasEmail: showAccountAlreadyHasEmail(self.viewModel) else: super(SteamAddEmailOverlayView, self)._handleError(response)
def nameIsTooShort(): return loc(_res.renamingOverlay.nameTooShort(), amount=FieldNameModel.NAME_LEN_MIN)
def serverUnavailableTimed(): return loc(_res.warningServerUnavailableTimed())
def spaPasswordIsWeak(): return loc(_res.spa.passwordIsWeak())
def passwordIsInvalid(): return loc(_res.badPassword())
def emailAlreadyTaken(): return loc(_res.emailAlreadyTaken())
def emailRestrictedByCountry(): return loc(_res.emailRestrictedByCountry())
def passwordIsTooLong(): return loc(_res.passwordIsTooLong(), amount=FieldPasswordModel.PASSWORD_LEN_MAX)
def passwordIsTooShort(): return loc(_res.passwordIsTooShort(), amount=FieldPasswordModel.PASSWORD_LEN_MIN)
def emailIsTooLong(): return loc(_res.emailIsTooLong(), amount=FieldEmailModel.EMAIL_LEN_MAX)
def emailIsTooShort(): return loc(_res.emailIsTooShort(), amount=FieldEmailModel.EMAIL_LEN_MIN)
def nameIsTooLong(): return loc(_res.renamingOverlay.nameToolong(), amount=FieldNameModel.NAME_LEN_MAX)
def nameInvalid(): return loc(_res.renamingOverlay.nameInvalid())
def emailIsInvalid(): return loc(_res.errorIsWrong())