I am uncertain what is the source of the problem here and due to I doubt
it is a bug, i checked what is available for django and thought the
mailing list is a good place to post this question.

You can see the issue better formatted here

https://stackoverflow.com/questions/57451323/django-template-permissions-not-working-when-used-inside-the-template-of-an-incl


I have 2 apps in a Django Project i am using to learn django. In the app
A I have an inclusion tag where I am using a template named
templateA.html. This inclusion tag is being used in the app B, inside
the template templateB.html. The content of templateA.html is shown
properly inside templateB.html. I noticed though that when I am
attempting to check permissions of the user using code similar to the
following:


   |{%ifperms.my_app.can_do_something %}show something here {%endif %}|


then, if I include that code in |templateA.html| it is *not* working,
while if I use it in |templateB.html| it is working properly.

Is there something else that needs to be done for permissions in
templates when are inside templates included in other templates? Am I
missing something else here?

Also in case it is relevant, to mention that i am using a custom user
model based on |AbstractUser| so i can add some more fields to the user
profile.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8d0dae9-c1fb-862e-3897-73a1f45c73b8%40mail.com.

Reply via email to