Guilherme Gondim  committed b8233a3

bug fixes

  • Participants
  • Parent commits cb4fc08
  • Branches 2.x-exper1

Comments (0)

Files changed (1)

File diario/

 from django.contrib import admin
 from django.utils.translation import ugettext_lazy as _
-from diario.models import Entry
 class BaseEntryAdmin(admin.ModelAdmin):
         otherwise returns ``False``.
-        has_change_permission = super(EntryAdmin, self).has_change_permission(request, obj)
+        has_change_permission = super(BaseEntryAdmin, self).has_change_permission(request, obj)
         if not has_change_permission:
             return False
         if obj is not None and not request.user.is_superuser:
         if request.user.is_superuser:
-            return Entry.objects.all()
-        return Entry.objects.filter(author=request.user)
+            return self.model.objects.all()
+        return self.model.objects.filter(author=request.user)
     def save_model(self, request, obj, form, change):
         """Automatically fill in the author field on creation."""
         if not change:
    = request.user
-        super(EntryAdmin, self).save_model(request, obj, form, change)
+        super(BaseEntryAdmin, self).save_model(request, obj, form, change)
 class EntryAdmin(BaseEntryAdmin):