Re: Admin: Making raw_id fields navigable for readonly users

2020-01-18 Thread Julien Rebetez
Thanks for the quick response !

> The link should only be rendered if the user has permission to view the 
> target model.

Right, didn't think about that. Will do

> Perhaps a stupid question, but — wouldn't this apply to non-raw_id, readonly 
> foreign keys as well? I don't think they're rendered as links, are they?

Indeed, they aren't rendered as links either. I'll apply it to both then.

I've opened a ticket and will continue documenting my progress there :
https://code.djangoproject.com/ticket/31181

On Sat, Jan 18, 2020 at 7:35 PM Aymeric Augustin
 wrote:
>
> Hello Julien,
>
> This would be a nice UX improvement. The link should only be rendered if the 
> user has permission to view the target model.
>
> Perhaps a stupid question, but — wouldn't this apply to non-raw_id, readonly 
> foreign keys as well? I don't think they're rendered as links, are they?
>
> Best regards,
>
> --
> Aymeric.
>
>
>
> On 18 Jan 2020, at 19:18, Julien Rebetez  wrote:
>
> Hello,
>
> When viewing a model with raw_id fields in the admin UI, if you only have 
> view permission, then those fields are not rendered as links (you cannot go 
> to the related model) - they are just plaintext.
>
> I that something that you would agree to change ? That would be helpful for 
> us at work as we have quite a few raw_id fields and have readonly users as 
> well.
>
> I have a working patch for this - just need to clean it up & add tests. So if 
> it's a welcome change, I'll go ahead and do a PR.
>
> Thanks
> Julien
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/9c38e6ad-d663-429b-a10b-5d8ce2906810%40googlegroups.com.
>
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-developers/XFoaohDpqZE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/FCDEAC08-D76E-4800-A8F4-1F537EC7D956%40polytechnique.org.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMYZvB%2BLTE0xnztcGS2DVOi0YKiuKu3KOj_e-sA7vt6FRCmMFQ%40mail.gmail.com.


Admin: Making raw_id fields navigable for readonly users

2020-01-18 Thread Julien Rebetez
Hello,

When viewing a model with raw_id fields in the admin UI, if you only have 
view permission, then those fields are not rendered as links (you cannot go 
to the related model) - they are just plaintext.

I that something that you would agree to change ? That would be helpful for 
us at work as we have quite a few raw_id fields and have readonly users as 
well.

I have a working patch for this - just need to clean it up & add tests. So 
if it's a welcome change, I'll go ahead and do a PR.

Thanks
Julien

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9c38e6ad-d663-429b-a10b-5d8ce2906810%40googlegroups.com.