django-braces icon indicating copy to clipboard operation
django-braces copied to clipboard

Cleaner approach to `HeaderMixin`

Open kennethlove opened this issue 2 years ago • 1 comments

satisfying

This PR introduces a backwards-compatible change to the HeaderMixin. Our existing method works but feels kind of heavy-handed. This approach is more in-line with Django's design, IMO, and doesn't feel as blunt.

Unfortunately, it only works if render_to_response is ultimately called, so I had to leave in the old approach as well. Maybe we should split it up into a new mixin?

kennethlove avatar Nov 17 '21 20:11 kennethlove

Codecov Report

Merging #285 (2f1a4ec) into main (df847c9) will increase coverage by 0.05%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
+ Coverage   97.72%   97.77%   +0.05%     
==========================================
  Files           8        8              
  Lines         484      495      +11     
  Branches       68       69       +1     
==========================================
+ Hits          473      484      +11     
  Misses          9        9              
  Partials        2        2              
Flag Coverage Δ
unittests 97.77% <100.00%> (+0.05%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
braces/views/_other.py 100.00% <100.00%> (ø)

codecov-commenter avatar Nov 18 '21 21:11 codecov-commenter