Fix country_id

This commit is contained in:
Виктор Гладких 2019-10-15 15:20:44 +03:00
parent e8d0045cec
commit ff7df815f4
3 changed files with 15 additions and 4 deletions

View 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 = [
]

View File

@ -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"""

View File

@ -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()