Changes between Version 44 and Version 45 of NewformsAdminBranch


Ignore:
Timestamp:
03/30/2008 04:00:49 AM (7 years ago)
Author:
anonymous
Comment:

Corrected has_change_permission override example.

Legend:

Unmodified
Added
Removed
Modified
  • NewformsAdminBranch

    v44 v45  
    126126    ordering = ('title',)
    127127
    128     def has_change_permission(self, request, obj):
     128    def has_change_permission(self, request, obj=None):
    129129        """
    130130        John can only edit books by Roald Dahl.
    131131        """
    132         if request.user.username == 'john':
     132        if obj and request.user.username == 'john':
    133133            return obj.author.last_name == 'Dahl'
    134134        return super(BookOptions, self).has_change_permission(request, obj)
Back to Top