Django 1.8 compatibility: module_name -> model_name

(imported from commit 38ee96c9a8da5b3abfce8ba47f85dd7d59bcb599)
This commit is contained in:
Reid Barton 2015-08-19 11:52:50 -07:00
parent e65d508907
commit 5ea3bf85de
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ class ConfirmationManager(models.Manager):
except self.model.DoesNotExist:
return False
obj = confirmation.content_object
status_field = get_status_field(obj._meta.app_label, obj._meta.module_name)
status_field = get_status_field(obj._meta.app_label, obj._meta.model_name)
setattr(obj, status_field, getattr(settings, 'STATUS_ACTIVE', 1))
obj.save()
return obj
@ -75,7 +75,7 @@ class ConfirmationManager(models.Manager):
if additional_context is not None:
context.update(additional_context)
templates = [
'confirmation/%s_confirmation_email_subject.txt' % obj._meta.module_name,
'confirmation/%s_confirmation_email_subject.txt' % obj._meta.model_name,
'confirmation/confirmation_email_subject.txt',
]
if subject_template_path:
@ -84,7 +84,7 @@ class ConfirmationManager(models.Manager):
template = loader.select_template(templates)
subject = template.render(context).strip().replace(u'\n', u' ') # no newlines, please
templates = [
'confirmation/%s_confirmation_email_body.txt' % obj._meta.module_name,
'confirmation/%s_confirmation_email_body.txt' % obj._meta.model_name,
'confirmation/confirmation_email_body.txt',
]
if body_template_path:

View File

@ -38,6 +38,6 @@ def confirm(request, confirmation_key):
]
if obj:
# if we have an object, we can use specific template
templates.insert(0, 'confirmation/confirm_%s.html' % obj._meta.module_name)
templates.insert(0, 'confirmation/confirm_%s.html' % obj._meta.model_name)
return render_to_response(templates, ctx,
context_instance=RequestContext(request))