Merge branch '6-permissions-not-created' into 'master'
Resolve "Permissions not created" Closes #6 See merge request startinblox/djangoldp-packages/djangoldp-notifications!10
This commit is contained in:
commit
47b85d01a9
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)
|
date = models.DateTimeField(auto_now_add=True)
|
||||||
unread = models.BooleanField(default=True)
|
unread = models.BooleanField(default=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta(Model.Meta):
|
||||||
permissions = (
|
|
||||||
('view_notification', 'Read'),
|
|
||||||
('control_notification', 'Control'),
|
|
||||||
)
|
|
||||||
permission_classes = [InboxPermissions]
|
permission_classes = [InboxPermissions]
|
||||||
ordering = ['date']
|
ordering = ['date']
|
||||||
|
|
||||||
@ -42,12 +38,6 @@ class Subscription(Model):
|
|||||||
object = models.URLField()
|
object = models.URLField()
|
||||||
inbox = models.URLField()
|
inbox = models.URLField()
|
||||||
|
|
||||||
class Meta:
|
|
||||||
permissions = (
|
|
||||||
('view_notification', 'Read'),
|
|
||||||
('control_notification', 'Control'),
|
|
||||||
)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '{}'.format(self.object)
|
return '{}'.format(self.object)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user