Skip to content

Commit

Permalink
add: missing href for button
Browse files Browse the repository at this point in the history
  • Loading branch information
saemideluxe committed Nov 27, 2021
1 parent 84c33bd commit 53e65c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bread/views/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ..formatters import format_value
from ..forms.fields import FormsetField
from ..forms.forms import breadmodelform_factory
from ..utils import expand_ALL_constant
from ..utils import ModelHref, expand_ALL_constant
from .edit import EditView
from .util import BreadView

Expand Down Expand Up @@ -56,7 +56,9 @@ def get_layout(self):
),
style="width: auto",
),
_layout.button.Button(_("Edit"), style="margin-top: 2rem"),
_layout.button.Button(_("Edit"), style="margin-top: 2rem").as_href(
ModelHref(self.model, "edit", kwargs={"pk": self.object.pk})
),
)

def get_context_data(self, *args, **kwargs):
Expand Down

0 comments on commit 53e65c8

Please sign in to comment.