Django 2.0 compatibility (requirement)

- URLs to path() style
- Misc updates
- Namespaces all URL references
- Removes dependency on AutoSlugField
- Cleaner reversals
- Cleaner docstrings
This commit is contained in:
Scot Hacker 2018-02-03 00:09:23 -08:00
parent 238e39085d
commit 90c41d1f29
13 changed files with 92 additions and 96 deletions

View file

@ -1,14 +1,12 @@
import datetime
from django.contrib import messages
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.template.loader import render_to_string
from todo.models import Item
# Need for links in email templates
current_site = Site.objects.get_current()
def mark_done(request, done_items):
# Check for items in the mark_done POST array. If present, change status to complete.
@ -39,6 +37,7 @@ def del_tasks(request, deleted_items):
def send_notify_mail(request, new_task):
# Send email
current_site = Site.objects.get_current()
email_subject = render_to_string("todo/email/assigned_subject.txt", {'task': new_task})
email_body = render_to_string(
"todo/email/assigned_body.txt",