# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from os.path import join, isfile
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from os.path import join, isfile
from django.db import models
from waiter.settings import WAITER_URL, WAITER_MAX_QUEUE
from waiter.utils import check_abspath
from django.db import models
from waiter.settings import WAITER_URL, WAITER_MAX_QUEUE
from waiter.utils import check_abspath
already = cls.exists(path)
if not already:
waited, created = cls.objects.get_or_create(path=path)
already = cls.exists(path)
if not already:
waited, created = cls.objects.get_or_create(path=path)
waited.task = task_creator(check_abspath(path), waited.pk)
waited.task_id = waited.task.task_id
waited.description = description
waited.task = task_creator(check_abspath(path), waited.pk)
waited.task_id = waited.task.task_id
waited.description = description