1.1.9 funcs for raise and highlight routes

This commit is contained in:
SDE
2024-06-03 02:46:58 +03:00
parent a83ff0e080
commit e319a8af46
11 changed files with 249 additions and 114 deletions

View File

@@ -67,7 +67,7 @@ class Route(BaseModel):
verbose_name=_('Дата и время последнего поднятия'),
blank=True, null=True
)
select_color = ColorField(
highlight_color = ColorField(
verbose_name=_('Цвет выделения'),
blank=True, null=True
)
@@ -84,6 +84,18 @@ class Route(BaseModel):
verbose_name_plural = _(u'Маршруты')
ordering = ('name',)
def get_permission_for_raise(self):
from SubscribesApp.funcs import get_cur_user_subscribe
user_subscribe = get_cur_user_subscribe(self.owner)
if not user_subscribe:
return False
data_Dict = user_subscribe.remains_route_adding_options()
if data_Dict['remains_route_rising_count'] > 0:
return True
return False
def from_country_n_city_str(self):
res = _('Неизвестно')
if self.from_city: