Merge branch 'develop' of ssh://gl.id-east.ru:222/gm/gm-backend into develop

This commit is contained in:
evgeniy-st 2019-10-31 17:38:07 +03:00
commit a44081c2e7
2 changed files with 3 additions and 7 deletions

View File

@ -1,5 +1,3 @@
from pprint import pprint
from django.core.management.base import BaseCommand
from django.db.models import Q
@ -19,8 +17,6 @@ class Command(BaseCommand):
Q(mark__isnull=True)
).filter(aasm_state='published').values_list('establishment_id', 'mark', 'updated_at')
print(queryset.count())
for es_id, new_mark, new_date in queryset:
try:
mark, date = valid_data[es_id]
@ -41,6 +37,5 @@ class Command(BaseCommand):
establishment.public_mark = int(value[0])
establishment.save()
count += 1
break
self.stdout.write(self.style.WARNING(f'Updated {count} objects.'))

View File

@ -172,8 +172,9 @@ class SiteSettings(ProjectBaseMixin):
@property
def published_sitefeatures(self):
return self.sitefeature_set\
.filter(Q(published=True) and Q(feature__source__in=[PlatformMixin.WEB, PlatformMixin.ALL]))
return self.sitefeature_set. \
filter(Q(published=True) &
Q(feature__source__in=[PlatformMixin.WEB, PlatformMixin.ALL]))
@property
def site_url(self):