Fix an error in WikiAttachmentViewSet

remotes/origin/enhancement/email-actions
David Barragán Merino 2013-10-22 14:56:20 +02:00
parent e24b3261a0
commit cc8543c2e6
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class WikiAttachmentViewSet(ModelCrudViewSet):
filter_fields = ["project", "object_id"] filter_fields = ["project", "object_id"]
def get_queryset(self): def get_queryset(self):
ct = ContentType.objects.get_for_model(models.Wiki) ct = ContentType.objects.get_for_model(models.WikiPage)
qs = super(WikiAttachmentViewSet, self).get_queryset() qs = super(WikiAttachmentViewSet, self).get_queryset()
qs = qs.filter(content_type=ct) qs = qs.filter(content_type=ct)
return qs.distinct() return qs.distinct()
@ -40,7 +40,7 @@ class WikiAttachmentViewSet(ModelCrudViewSet):
def pre_save(self, obj): def pre_save(self, obj):
if not obj.id: if not obj.id:
obj.content_type = ContentType.objects.get_for_model(models.Wiki) obj.content_type = ContentType.objects.get_for_model(models.WikiPage)
obj.owner = self.request.user obj.owner = self.request.user
super(WikiAttachmentViewSet, self).pre_save(obj) super(WikiAttachmentViewSet, self).pre_save(obj)