State test news with contentpage permission
This commit is contained in:
parent
e0352b7d93
commit
376c8cdff3
|
|
@ -119,7 +119,8 @@ class NewsTestCase(BaseTestCase):
|
|||
'slug': self.test_news.slug,
|
||||
'start': self.test_news.start,
|
||||
'news_type_id': self.test_news.news_type_id,
|
||||
'country_id': self.country_ru.id
|
||||
'country_id': self.country_ru.id,
|
||||
"site_id": self.site_ru.id
|
||||
}
|
||||
|
||||
response = self.client.put(url, data=data, format='json')
|
||||
|
|
|
|||
|
|
@ -36,10 +36,6 @@ class ProjectBaseMixin(models.Model):
|
|||
abstract = True
|
||||
|
||||
|
||||
def valid(value):
|
||||
print("Run")
|
||||
|
||||
|
||||
class TJSONField(JSONField):
|
||||
"""Overrided JsonField."""
|
||||
|
||||
|
|
|
|||
|
|
@ -118,15 +118,9 @@ class IsContentPageManager(IsStandardUser):
|
|||
super().has_permission(request, view)
|
||||
]
|
||||
# and request.user.email_confirmed,
|
||||
if hasattr(request, 'user'):
|
||||
site_id = None
|
||||
if hasattr(request, 'data'):
|
||||
site_id = request.data['site_id']
|
||||
else:
|
||||
site_id = request.site_id
|
||||
|
||||
if hasattr(request, 'user') and hasattr(request.data, 'site_id'):
|
||||
role = Role.objects.filter(role=Role.CONTENT_PAGE_MANAGER,
|
||||
site_id=site_id) \
|
||||
site_id=request.data.site_id,) \
|
||||
.first() # 'Comments moderator'
|
||||
|
||||
rules = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user