Exemple #1
0
    def post(self):
        user_logado = users.get_current_user()
        date = datetime.now() - timedelta(hours=timezone)

        if not RegistraCafe.getJaFez() and\
     (date.hour >= 9 and date.hour < 18) and\
              (date.weekday() != 5 and date.weekday() != 6) or DEBUG == True:

            fez = RegistraCafe(user=user_logado, date_creation=date)
            fez.save()
            memcache.delete('context_home')

            todos_usuarios = RegistraCafe.getQuantidadeCafe()
            for item in todos_usuarios:
                user = item.get('user_email', '')
                self.sendMail(user, date, user_logado.email())

        self.redirect('/')
Exemple #2
0
    def post(self):
        user_logado = users.get_current_user()
        date = datetime.now() - timedelta(hours=timezone)
        
        if not RegistraCafe.getJaFez() and\
			  (date.hour >= 9 and date.hour < 18) and\
              (date.weekday() != 5 and date.weekday() != 6) or DEBUG == True:
            
            fez = RegistraCafe(user = user_logado,
                               date_creation = date)
            fez.save()
            memcache.delete('context_home')
        
            todos_usuarios = RegistraCafe.getQuantidadeCafe()
            for item in todos_usuarios:
                user = item.get('user_email','')
                self.sendMail(user, date, user_logado.email())
            
        self.redirect('/')