Merge branch 'develop' of ssh://gl.id-east.ru:222/gm/gm-backend into develop
This commit is contained in:
commit
a44081c2e7
|
|
@ -1,5 +1,3 @@
|
||||||
from pprint import pprint
|
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
|
|
@ -19,8 +17,6 @@ class Command(BaseCommand):
|
||||||
Q(mark__isnull=True)
|
Q(mark__isnull=True)
|
||||||
).filter(aasm_state='published').values_list('establishment_id', 'mark', 'updated_at')
|
).filter(aasm_state='published').values_list('establishment_id', 'mark', 'updated_at')
|
||||||
|
|
||||||
print(queryset.count())
|
|
||||||
|
|
||||||
for es_id, new_mark, new_date in queryset:
|
for es_id, new_mark, new_date in queryset:
|
||||||
try:
|
try:
|
||||||
mark, date = valid_data[es_id]
|
mark, date = valid_data[es_id]
|
||||||
|
|
@ -41,6 +37,5 @@ class Command(BaseCommand):
|
||||||
establishment.public_mark = int(value[0])
|
establishment.public_mark = int(value[0])
|
||||||
establishment.save()
|
establishment.save()
|
||||||
count += 1
|
count += 1
|
||||||
break
|
|
||||||
|
|
||||||
self.stdout.write(self.style.WARNING(f'Updated {count} objects.'))
|
self.stdout.write(self.style.WARNING(f'Updated {count} objects.'))
|
||||||
|
|
|
||||||
|
|
@ -172,8 +172,9 @@ class SiteSettings(ProjectBaseMixin):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def published_sitefeatures(self):
|
def published_sitefeatures(self):
|
||||||
return self.sitefeature_set\
|
return self.sitefeature_set. \
|
||||||
.filter(Q(published=True) and Q(feature__source__in=[PlatformMixin.WEB, PlatformMixin.ALL]))
|
filter(Q(published=True) &
|
||||||
|
Q(feature__source__in=[PlatformMixin.WEB, PlatformMixin.ALL]))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def site_url(self):
|
def site_url(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user