0.1.31
search routes page
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
from .models import *
|
||||
def get_routes_for_user(user):
|
||||
def get_routes_Dict(user=None):
|
||||
from ReferenceDataApp.models import Airport, Country, City
|
||||
|
||||
if not user and user.is_authenticated:
|
||||
errors_Dict = {
|
||||
'errors': {
|
||||
'all__': f'ошибка идентификации пользователя'
|
||||
}
|
||||
}
|
||||
return errors_Dict
|
||||
# if not user and user.is_authenticated:
|
||||
# errors_Dict = {
|
||||
# 'errors': {
|
||||
# 'all__': f'ошибка идентификации пользователя'
|
||||
# }
|
||||
# }
|
||||
# return errors_Dict
|
||||
kwargs = {}
|
||||
if user:
|
||||
kwargs.update({
|
||||
'owner': user
|
||||
})
|
||||
|
||||
routes = Route.objects.filter(owner=user)
|
||||
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
||||
|
||||
res_Dict = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user