0.11.20 push w link

This commit is contained in:
SDE
2024-01-16 16:53:01 +03:00
parent 793d283d97
commit 87fbe7852c
9 changed files with 118 additions and 35 deletions

View File

@@ -13,6 +13,16 @@ def get_options_by_opt_types(opt_types, only_vals=False):
res = {}
opts = opts.values('opt_type', 'value', 'prefix')
for item in opts:
if item['opt_type'] == 'domain':
try:
from django.contrib.sites.models import Site
current_site = Site.objects.get_current()
res.update({item['opt_type']: current_site.domain})
continue
except Exception as e:
print(str(e))
if item['prefix']:
res.update({item['opt_type']: f"{item['prefix']}{item['value']}"})
else:
@@ -29,6 +39,6 @@ def get_first_option_value_by_opt_type(opt_type):
return None
def get_mail_send_options():
opt_types = ['mail_server_url', 'mail_server_smtp_port', 'sender_mail_login', 'sender_mail_password', 'sender_email']
opt_types = ['mail_server_url', 'mail_server_smtp_port', 'sender_mail_login', 'sender_mail_password', 'sender_email', 'project_name']
return get_options_by_opt_types(opt_types, only_vals=True)

View File

@@ -19,13 +19,13 @@ def test_code(request):
from RoutesApp.models import Route
from ReferenceDataApp.models import Airport, City
import allauth
from allauth.socialaccount.models import SocialApp
apps = SocialApp.objects.all()
apps.delete()
# import allauth
# from allauth.socialaccount.models import SocialApp
# apps = SocialApp.objects.all()
# apps.delete()
# from RoutesApp.search_matches import search_matches
# search_matches()
from RoutesApp.search_matches import search_matches
search_matches()
# try:
# # body = request.body