update: fix permissions on Nofication, Meta must inherit Model.Meta
This commit is contained in:
parent
c9b3155f08
commit
ea7caa64f8
23
djangoldp_notification/migrations/0004_auto_20190425_1141.py
Normal file
23
djangoldp_notification/migrations/0004_auto_20190425_1141.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11 on 2019-04-25 11:41
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('djangoldp_notification', '0003_auto_20190404_0343'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='notification',
|
||||
options={'default_permissions': ('add', 'change', 'delete', 'view', 'control'), 'ordering': ['date']},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='subscription',
|
||||
options={'default_permissions': ('add', 'change', 'delete', 'view', 'control')},
|
||||
),
|
||||
]
|
@ -26,11 +26,7 @@ class Notification(Model):
|
||||
date = models.DateTimeField(auto_now_add=True)
|
||||
unread = models.BooleanField(default=True)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
('view_notification', 'Read'),
|
||||
('control_notification', 'Control'),
|
||||
)
|
||||
class Meta(Model.Meta):
|
||||
permission_classes = [InboxPermissions]
|
||||
ordering = ['date']
|
||||
|
||||
@ -42,12 +38,6 @@ class Subscription(Model):
|
||||
object = models.URLField()
|
||||
inbox = models.URLField()
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
('view_notification', 'Read'),
|
||||
('control_notification', 'Control'),
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return '{}'.format(self.object)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user