1.4.0 sitemap
This commit is contained in:
@@ -13,15 +13,15 @@ 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['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']}"})
|
||||
|
||||
Reference in New Issue
Block a user