def isRequestValid(self, requestTypeID): if requestTypeID in self.__restrictions: for restriction in self.__restrictions[requestTypeID]: if not restriction.isExpired(): return error(restriction.getReasonString()) return success()
def canChangeWebSettings(self, profile, club = None): url = GUI_SETTINGS.lookup('clubSettings') if not url: return error(_CCR.DEFAULT) else: if club is not None: permissions = club.getPermissions() if not permissions.canChangeWebSettings(): return error(_CCR.DEFAULT) if club.getTotalDossier().getTotalStats().getBattlesCount() < CLUB_LIMITS.MIN_BATTLES_COUNT_TO_CHANGE_NAME: return error(_CCR.NOT_ENOUGH_RATED_BATTLES) return success()
def canChangeWebSettings(self, profile, club = None): url = GUI_SETTINGS.lookup('clubSettings') if not url: return error(_CCR.DEFAULT) if club is not None: for rID in {_CRT.CHANGE_CLUB_NAME, _CRT.CHANGE_CLUB_EMBLEM}: result = self._isClubRequestValid(rID, club, 'canChangeWebSettings') if result.success: return result return error(_CCR.NOT_ENOUGH_RATED_BATTLES) return success()
def isRequestValid(self, requestTypeID): if requestTypeID in self.__restrictions: return error(first(self.__restrictions[requestTypeID]).getReasonString()) return success()
def isRequestValid(self, requestTypeID): if requestTypeID in self.__restrictions: return error( first(self.__restrictions[requestTypeID]).getReasonString()) return success()