Fix country_id
This commit is contained in:
parent
e8d0045cec
commit
ff7df815f4
14
apps/account/migrations/0012_merge_20191015_0708.py
Normal file
14
apps/account/migrations/0012_merge_20191015_0708.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 2.2.4 on 2019-10-15 07:08
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('account', '0011_merge_20191014_0839'),
|
||||
('account', '0011_merge_20191014_1258'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
|
|
@ -45,9 +45,6 @@ class Comment(ProjectBaseMixin):
|
|||
objects = CommentQuerySet.as_manager()
|
||||
country = models.ForeignKey(Country, verbose_name=_('Country'),
|
||||
on_delete=models.SET_NULL, null=True)
|
||||
# language = models.ForeignKey(Language, verbose_name=_('Locale'),
|
||||
# on_delete=models.SET_NULL, null=True
|
||||
# )
|
||||
|
||||
class Meta:
|
||||
"""Meta class"""
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class IsCommentModerator(IsStandardUser):
|
|||
|
||||
# Must have role
|
||||
role = Role.objects.filter(role=Role.COMMENTS_MODERATOR,
|
||||
country__languages__id=obj.language_id)\
|
||||
country_id=obj.country_id)\
|
||||
.first() # 'Comments moderator'
|
||||
|
||||
is_access = UserRole.objects.filter(user=request.user, role=role).exists()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user