Fixed dtails view

This commit is contained in:
Martin Mahner 2018-03-27 20:55:02 +02:00
parent c65f225612
commit ac8789e442

View file

@ -129,13 +129,12 @@ class SnippetDetailView(SnippetView, DetailView):
# Remove blank lines # Remove blank lines
return highlighted.replace('\n\n', '\n') return highlighted.replace('\n\n', '\n')
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
snippet = self.get_object() self.object = self.get_object()
ctx = super(SnippetDetailView, self).get_context_data(**kwargs) ctx = super(SnippetDetailView, self).get_context_data(**kwargs)
ctx.update({ ctx.update({
'wordwrap': snippet.lexer in highlight.LEXER_WORDWRAP, 'wordwrap': self.object.lexer in highlight.LEXER_WORDWRAP,
'diff': self.get_snippet_diff(), 'diff': self.get_snippet_diff(),
}) })
return ctx return ctx