|
@@ -118,13 +118,16 @@ class LangAVSSView(TemplateView):
|
|
for location in locations:
|
|
for location in locations:
|
|
# print(location['filename'])
|
|
# print(location['filename'])
|
|
# print(location['line'])
|
|
# print(location['line'])
|
|
-
|
|
|
|
- locationValue = {
|
|
|
|
- 'lk': lkModel,
|
|
|
|
- 'filename': location['filename'],
|
|
|
|
- 'line': location['line']
|
|
|
|
- }
|
|
|
|
- LangLocationModel.objects.create(**locationValue)
|
|
|
|
|
|
+ langlocaltionmodel = LangLocationModel.objects.filter(lk=lkModel, filename=location['filename'])
|
|
|
|
+ if langlocaltionmodel.exists():
|
|
|
|
+ langlocaltionmodel.update(line=location['line'])
|
|
|
|
+ else:
|
|
|
|
+ locationValue = {
|
|
|
|
+ 'lk': lkModel,
|
|
|
|
+ 'filename': location['filename'],
|
|
|
|
+ 'line': location['line']
|
|
|
|
+ }
|
|
|
|
+ LangLocationModel.objects.create(**locationValue)
|
|
return response.json(0)
|
|
return response.json(0)
|
|
else:
|
|
else:
|
|
return response.json(444)
|
|
return response.json(444)
|