diefenbach / django-permissions

BSD 3-Clause "New" or "Revised" License
13 stars 12 forks source link

Fix caching when obj=None #5

Closed bport closed 9 years ago

diefenbach commented 9 years ago

I can't see any difference in the result. Can you elaborate?

bport commented 9 years ago

yes sure: we check if obj is not none because ContentType.objects.get_for_model(obj) don't support None values for object

diefenbach commented 9 years ago

Yes, but the existing code does this also. Any problems with that?

bport commented 9 years ago

ctype = ContentType.objects.get_for_model(obj)

when you call this line you didn't check if obj exist

you can see stacktrace problem on this related issue: https://github.com/diefenbach/django-permissions/issues/2

diefenbach commented 9 years ago

Ah, I see. Thx.

bport commented 9 years ago

Hi, it is possible to backport it to 1.2 branch and release a 1.2.3 version? thanks

diefenbach commented 9 years ago

Sure, will do that.