mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 08:47:49 +08:00
Make SuccessMessageMixin fully compatible with FormMixin (#86)
This ensures that the order in which these mixins are included into a derrived class does not matter and ends up more accurately reflecting the return type of SuccessMessageMixin in the process (its code doesn't appear to enforce that the returned response is a redirect). This provides a fix to a secondary aspect of https://github.com/mkurnikov/django-stubs/issues/79.
This commit is contained in:
committed by
Maxim Kurnikov
parent
db7b46589f
commit
861c6653fd
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user