Private
Public Access
1
0

testing tasks and messages

This commit is contained in:
Sander Roosendaal
2017-05-10 07:38:14 +02:00
parent 5857c13330
commit c4ffddfb06
39 changed files with 37 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ from django.conf import settings
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib import messages
# Project
# from .models import Profile
@@ -43,6 +44,22 @@ from rowsandall_app.settings import (
tpapilocation = "https://api.trainingpeaks.com"
from celery import Celery,app
import time
from async_messages import message_user
@app.task
def addcomment(userid,id):
time.sleep(5)
w = Workout.objects.get(id=id)
w.notes += '\n the task has run'
w.save()
u = User.objects.get(id=userid)
message_user(u,' The task has run')
return 1
# Custom error class - to raise a NoTokenError
class TPNoTokenError(Exception):
def __init__(self,value):