diff --git a/eshop/contact_us/context_processors.py b/eshop/contact_us/context_processors.py index 81affd9..ed5f42e 100644 --- a/eshop/contact_us/context_processors.py +++ b/eshop/contact_us/context_processors.py @@ -15,12 +15,12 @@ def contact_us_form(request): 'left_contact_us_form': ContactUsForm( next=request.resolver_match.view_name, kwargs=request.resolver_match.kwargs, - field_css_base_class='left-menu' + field_css_class_base='left-menu' ), 'content_contact_us_form': ContactUsForm( next=request.resolver_match.view_name, kwargs=request.resolver_match.kwargs, - field_css_base_class='contact' + field_css_class_base='contact' ), 'contact_us_form_message': message } diff --git a/eshop/contact_us/forms.py b/eshop/contact_us/forms.py index 86f240f..f9b145c 100644 --- a/eshop/contact_us/forms.py +++ b/eshop/contact_us/forms.py @@ -12,16 +12,14 @@ from .models import ( ) -# -------------------------------- Client-side forms -----------------------------------# - - class ContactUsForm(RequestNotifiable, forms.ModelForm): field_template = 'bootstrap/forms/contact_us.html' def __init__(self, *args, **kwargs): self.next = kwargs.pop('next') - self.next_kwargs = kwargs.pop('kwargs') - self.field_css = kwargs.pop('field_css_base_class') + # TODO: kwargs don't have the kwargs key. Check it! + self.next_kwargs = kwargs.pop('kwargs', {}) + self.field_css = kwargs.pop('field_css_class_base') self.helper = FormHelper() self.helper.form_action = reverse_lazy('contact_us:send') diff --git a/eshop/contact_us/models.py b/eshop/contact_us/models.py index a673537..861f93b 100644 --- a/eshop/contact_us/models.py +++ b/eshop/contact_us/models.py @@ -2,8 +2,6 @@ from django.core.validators import RegexValidator from django.db import models from django.utils.translation import ugettext_lazy as _ -# Create your models here. - # --------------------- REQUEST STATUS LIST -------------------- STATUS_NEW = 0 diff --git a/eshop/core/models.py b/eshop/core/models.py index 5b377ff..31d556f 100644 --- a/eshop/core/models.py +++ b/eshop/core/models.py @@ -1,7 +1,4 @@ -from abc import abstractmethod - from django.conf import settings -from django.contrib.auth.base_user import BaseUserManager from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.db import models