Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SuccessMessageMixin fully compatible with FormMixin #86

Merged
merged 1 commit into from Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions django-stubs/contrib/messages/views.pyi
@@ -1,9 +1,9 @@
from typing import Any, Dict, Optional

from django.forms.forms import BaseForm
from django.http.response import HttpResponseRedirect
from django.http.response import HttpResponse

class SuccessMessageMixin:
success_message: str = ...
def form_valid(self, form: BaseForm) -> HttpResponseRedirect: ...
def form_valid(self, form: BaseForm) -> HttpResponse: ...
def get_success_message(self, cleaned_data: Dict[str, str]) -> str: ...
10 changes: 10 additions & 0 deletions test-data/typecheck/messages.test
@@ -0,0 +1,10 @@
[CASE successmessagemixin_compatible_with_formmixin]
from django.views.generic.edit import FormMixin
from django.contrib.messages.views import SuccessMessageMixin

class FormFirstView(FormMixin, SuccessMessageMixin):
pass

class SuccessMessageFirstView(FormMixin, SuccessMessageMixin):
pass
[/CASE]