0.10.2 mail alert by new routes
This commit is contained in:
@@ -10,8 +10,15 @@ def get_options_by_opt_types(opt_types, only_vals=False):
|
||||
|
||||
opts = Option.objects.filter(**kwargs)
|
||||
if opts and only_vals:
|
||||
opts = opts.values('opt_type', 'value')
|
||||
opts = {item['opt_type']: item['value'] for item in opts}
|
||||
res = {}
|
||||
opts = opts.values('opt_type', 'value', 'prefix')
|
||||
for item in opts:
|
||||
if item['prefix']:
|
||||
res.update({item['opt_type']: f"{item['prefix']}{item['value']}"})
|
||||
else:
|
||||
res.update({item['opt_type']: f"{item['value']}"})
|
||||
return res
|
||||
|
||||
return opts
|
||||
|
||||
def get_first_option_value_by_opt_type(opt_type):
|
||||
|
||||
Reference in New Issue
Block a user