Private
Public Access
1
0

messages working

This commit is contained in:
Sander Roosendaal
2017-05-10 10:11:57 +02:00
parent c4ffddfb06
commit 4aa7b7151a
6 changed files with 36 additions and 4 deletions

View File

@@ -27,7 +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
#from django.contrib import messages
# Project
# from .models import Profile
@@ -46,7 +46,7 @@ tpapilocation = "https://api.trainingpeaks.com"
from celery import Celery,app
import time
from async_messages import message_user
from async_messages import message_user,messages
@app.task
def addcomment(userid,id):
@@ -55,7 +55,7 @@ def addcomment(userid,id):
w.notes += '\n the task has run'
w.save()
u = User.objects.get(id=userid)
message_user(u,' The task has run')
messages.info(u,' The task has run')
return 1

View File

@@ -2183,6 +2183,7 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
})
from rowers.tpstuff import addcomment
from django.contrib import messages
# Test asynchronous tasking and messaging
@login_required()
def workout_test_task_view(request,id=0):