This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/twitter/bootstrap/issues/675#issuecomment-6184243 | |
$('#feedback-modal').modal({ | |
backdrop: true, | |
keyboard: true | |
}).css({ | |
'width': function () { | |
return ($(document).width() * .9) + 'px'; | |
}, | |
'margin-left': function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.exceptions import PermissionDenied | |
from django.contrib import admin | |
from crm.models import Customer | |
class ReadPermissionModelAdmin(admin.ModelAdmin): | |
def has_change_permission(self, request, obj=None): | |
if getattr(request, 'readonly', False): | |
return True | |
return super(ReadPermissionModelAdmin, self).has_change_permission(request, obj) |