Skip to content
Snippets Groups Projects
Commit 09951d81 authored by Julian's avatar Julian
Browse files

Add request argument in get_context method

parent 7f7264c8
No related branches found
No related tags found
1 merge request!452Resolve "Provide request in DashboardWidget.get_context"
Pipeline #5415 passed
......@@ -665,7 +665,7 @@ class DashboardWidget(PolymorphicModel, PureDjangoModel):
class MyWidget(DhasboardWIdget):
template = "myapp/widget.html"
def get_context(self):
def get_context(self, request):
context = {"some_content": "foo"}
return context
......@@ -718,7 +718,7 @@ class DashboardWidget(PolymorphicModel, PureDjangoModel):
default=4,
)
def get_context(self):
def get_context(self, request):
"""Get the context dictionary to pass to the widget template."""
raise NotImplementedError("A widget subclass needs to implement the get_context method.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment