from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import os
import sys
import django
proj_path = "../"
sys.path.append(proj_path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rowsandall_app.settings")
django.setup()

import time
from celery import app
from django_rq import job
from rowers.models import Workout
from django.contrib.auth.models import User


@app.task
def addcomment2(userid,id,debug=False):
    
    time.sleep(5)
#    w = Workout.objects.get(id=id)
#    w.notes += '\n the task has run'
#    w.save()
    u = User.objects.get(id=userid)
    messages.info(u,' The task has run')
    messages.error(u,' Het is veel te laat')
    return 1
