# Path: pttrack/decorators.py
# def provider_required(func):
#     return user_passes_test(provider_exists, login_url=reverse_lazy('new-provider'))(func)
# 
# def clintype_required(func):
#     return session_passes_test(clintype_set, fail_url=reverse_lazy('choose-clintype'))(func)
# 
# def provider_update_required(func):
#     return user_passes_test(provider_has_updated, login_url=reverse_lazy('provider-update'))(func)


from django.conf.urls import url
from django.views.generic import DetailView
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from .decorators import provider_required, clintype_required, \
    provider_update_required
from . import models
from . import views
        name='new-action-item'),
    url(r'^action-item/(?P<pk>[0-9]+)/update$',
        views.ActionItemUpdate.as_view(),
        name="update-action-item"),
    url(r'^action-item/(?P<ai_id>[0-9]+)/done$',
        views.done_action_item,
        name=models.ActionItem.MARK_DONE_URL_NAME),
    url(r'^action-item/(?P<ai_id>[0-9]+)/reset$',
        views.reset_action_item,
        name='reset-action-item'),

    # DOCUMENTS
    url(r'^(?P<pt_id>[0-9]+)/document/$',
        views.DocumentCreate.as_view(),
        name="new-document"),
    url(r'^document/(?P<pk>[0-9]+)$',
        DetailView.as_view(model=models.Document),
        name="document-detail"),
    url(r'^document/update/(?P<pk>[0-9]+)$',
        views.DocumentUpdate.as_view(),
        name="document-update"),

    # MISC
    url(r'^about/',
        TemplateView.as_view(template_name='pttrack/about.html'),
        name='about'),
]


def wrap_url(url, no_wrap=[], login_only=[], provider_only=[],

# Path: pttrack/decorators.py
# def provider_required(func):
#     return user_passes_test(provider_exists, login_url=reverse_lazy('new-provider'))(func)
# 
# def clintype_required(func):
#     return session_passes_test(clintype_set, fail_url=reverse_lazy('choose-clintype'))(func)
# 
# def provider_update_required(func):
#     return user_passes_test(provider_has_updated, login_url=reverse_lazy('provider-update'))(func)


# Path: pttrack/urls.py
from django.conf.urls import url
from django.views.generic import DetailView
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from .decorators import provider_required, clintype_required, \
    provider_update_required
from . import models
from . import views

        name='new-action-item'),
    url(r'^action-item/(?P<pk>[0-9]+)/update$',
        views.ActionItemUpdate.as_view(),
        name="update-action-item"),
    url(r'^action-item/(?P<ai_id>[0-9]+)/done$',
        views.done_action_item,
        name=models.ActionItem.MARK_DONE_URL_NAME),
    url(r'^action-item/(?P<ai_id>[0-9]+)/reset$',
        views.reset_action_item,
        name='reset-action-item'),

    # DOCUMENTS
    url(r'^(?P<pt_id>[0-9]+)/document/$',
        views.DocumentCreate.as_view(),
        name="new-document"),
    url(r'^document/(?P<pk>[0-9]+)$',
        DetailView.as_view(model=models.Document),
        name="document-detail"),
    url(r'^document/update/(?P<pk>[0-9]+)$',
        views.DocumentUpdate.as_view(),
        name="document-update"),

    # MISC
    url(r'^about/',
        TemplateView.as_view(template_name='pttrack/about.html'),
        name='about'),
]


def wrap_url(url, no_wrap=[], login_only=[], provider_only=[],

             updated_provider_only=[]):