Skip to content

Commit 9d99cb5

Browse files
committed
fix: fix bug with V3AllTypesCreateView skipping dispatch check
1 parent e0aac02 commit 9d99cb5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

news/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ def get_context_data(self, **kwargs):
343343

344344

345345
class V3AllTypesCreateView(V3Mixin, AllTypesCreateView):
346-
template_name = None
347346
v3_template_name = "news/v3/create.html"
348347
http_method_names = ["get", "post"]
349348

@@ -354,6 +353,13 @@ class V3AllTypesCreateView(V3Mixin, AllTypesCreateView):
354353
"video": (Video, VideoForm),
355354
}
356355

356+
def dispatch(self, request, *args, **kwargs):
357+
# Run AllTypesCreateView's profile-completeness guard before V3Mixin takes over.
358+
response = AllTypesCreateView.dispatch(self, request, *args, **kwargs)
359+
if response.status_code != 200:
360+
return response
361+
return super().dispatch(request, *args, **kwargs)
362+
357363
def get_context_data(self, **kwargs):
358364
context = super().get_context_data(**kwargs)
359365
context.update(_v3_create_context())

0 commit comments

Comments
 (0)