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