Juggernaut Updated

This commit is contained in:
Ubuntu 2024-06-05 06:30:23 +00:00
parent c9881ca57d
commit 67ee372b98
1 changed files with 5 additions and 4 deletions

View File

@ -378,10 +378,7 @@ def update_narration(user_data,service_data, **kwargs):
return("updated_narration",user_data) return("updated_narration",user_data)
def update_conversion(user_data, service_data, **kwargs): def update_conversion(user_data, service_data, **kwargs):
user_data.conversion_pages -= kwargs['conversion_pages']
if user_data.conversion_pages < 0:
user_data.conversion_pages = 0
user_data.save()
if JuggernautConversion.objects.filter(associated_project=kwargs['associated_project']).exists(): if JuggernautConversion.objects.filter(associated_project=kwargs['associated_project']).exists():
conversion_juggernaut = JuggernautConversion.objects.get(associated_project=kwargs['associated_project']) conversion_juggernaut = JuggernautConversion.objects.get(associated_project=kwargs['associated_project'])
juggernaut_language_sets = JuggernautConversionSet.objects.filter(associated_project=kwargs['associated_project']) juggernaut_language_sets = JuggernautConversionSet.objects.filter(associated_project=kwargs['associated_project'])
@ -394,6 +391,10 @@ def update_conversion(user_data, service_data, **kwargs):
conversion_juggernaut.languages += 1 conversion_juggernaut.languages += 1
conversion_juggernaut.save() conversion_juggernaut.save()
else: else:
user_data.conversion_pages -= kwargs['conversion_pages']
if user_data.conversion_pages < 0:
user_data.conversion_pages = 0
user_data.save()
jcs = JuggernautConversionSet() jcs = JuggernautConversionSet()
jcs.associated_project = kwargs['associated_project'] jcs.associated_project = kwargs['associated_project']
jcs.actionline_lang = kwargs['translation_language'][0] jcs.actionline_lang = kwargs['translation_language'][0]