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

Added Custom HTML Template

Open jay-ponce opened this issue 2 years ago • 9 comments

Middleware Changes:

  • Import render
  • Create self.denied_template = getattr(settings, 'ADMINRESTRICT_TEMPLATE', '')
  • Add condition statement under GET to check if denied_template is configured
  • Change condition statement under POST to check if denied_template is configured

Test Changes:

  • Created test for custom template: LINE 93

README Changes:

  • Added Line 148 and 149 to describe new feature

SETUP Changes:

  • Changed from version 3.0 to 3.0.1

jay-ponce avatar Apr 09 '22 02:04 jay-ponce

Sorry for taking so long to get to this. This is a great idea!

Seeing some build failures (just migrated from Travis CI to Github Actions). Please take a look if you are still working on this and have time.

Many thanks,

robromano avatar Jul 31 '22 23:07 robromano

Sorry for taking so long to get to this. This is a great idea!

Seeing some build failures (just migrated from Travis CI to Github Actions). Please take a look if you are still working on this and have time.

Many thanks,

I am having issues with testing. When can we collaborate on this via WebEx?

jay-ponce avatar Oct 12 '22 21:10 jay-ponce

I had to enable running the build for this PR.

Looks like you should be able to view the build failures and debug now.

Current failure: https://github.com/robromano/django-adminrestrict/actions/runs/3237830528/jobs/5328097274

robromano avatar Oct 14 '22 14:10 robromano

I am having issues with testing. When can we collaborate on this via WebEx?

Let me know if the build output I posted is helping you test. Even if you can't run test locally each push you do should trigger a build and you can see if your fixes work.

If that doesn't work let me know a time we can setup a call.

robromano avatar Oct 15 '22 01:10 robromano

I believe the testing should pass now. By default, I was returning the resp.content as DENIED_MSG instead of the DENIED_Template.

jay-ponce avatar Oct 15 '22 02:10 jay-ponce

Codecov Report

Base: 93.38% // Head: 93.36% // Decreases project coverage by -0.01% :warning:

Coverage data is based on head (2240790) compared to base (f9d0ef8). Patch coverage: 93.75% of modified lines in pull request are covered.

:exclamation: Current head 2240790 differs from pull request most recent head 0c134fa. Consider uploading reports for the commit 0c134fa to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   93.38%   93.36%   -0.02%     
==========================================
  Files          11       11              
  Lines         408      422      +14     
==========================================
+ Hits          381      394      +13     
- Misses         27       28       +1     
Impacted Files Coverage Δ
adminrestrict/middleware.py 85.43% <87.50%> (-0.09%) :arrow_down:
adminrestrict/tests.py 99.43% <100.00%> (+0.02%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Oct 15 '22 02:10 codecov[bot]

There are some failures:

https://github.com/robromano/django-adminrestrict/actions/runs/3301836464

robromano avatar Oct 23 '22 01:10 robromano

There are some failures:

https://github.com/robromano/django-adminrestrict/actions/runs/3301836464

Thanks! I fixed what I did wrong. Hopefully this time is the charm. 🤞

jay-ponce avatar Oct 23 '22 05:10 jay-ponce

There are some failures:

https://github.com/robromano/django-adminrestrict/actions/runs/3301836464

Thanks!

I fixed what I did wrong.

Hopefully this time is the charm. 🤞

Some errors still - https://github.com/robromano/django-adminrestrict/actions/runs/3305906123/jobs/5456449947

robromano avatar Nov 05 '22 01:11 robromano