Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopened #522

Open
wants to merge 14 commits into
base: test
Choose a base branch
from
4 changes: 1 addition & 3 deletions application/workprogramsapp/files_export/views.py
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ def render_context(context, **kwargs):
if ev_tool not in evaluation_tools:
evaluation_tools.append(ev_tool)
for j in i['topics']:
topics_list.append(j['description'])
topics_list.append(j['description'].replace("<", "").replace(">", ""))
if j['url_online_course'] is None:
pass
else:
@@ -364,8 +364,6 @@ def render_context(context, **kwargs):
template_context['extra_points'] = context['extra_points']
template_context['discipline_section'] = context['discipline_sections']
template_context['bars'] = context["bars"]
print('bib', template_context['bibliographic_reference'])
print(semester)
return template_context, filename
# , evaluation_tools_pdf_docs

35 changes: 14 additions & 21 deletions application/workprogramsapp/views.py
Original file line number Diff line number Diff line change
@@ -505,19 +505,15 @@ class OutcomesOfWorkProgramDestroyView(generics.DestroyAPIView):
permission_classes = [IsRpdDeveloperOrReadOnly]

def delete(self, request, *args, **kwargs):
try:
obj = OutcomesOfWorkProgram.objects.get(pk=kwargs['pk'])

# изменяем значение value для item
item = Items.objects.get(name=obj.item)
value = item.value
item.value = int(value) - 1
item.save()
obj = OutcomesOfWorkProgram.objects.get(pk=kwargs['pk'])

return self.destroy(request, *args, **kwargs)
except:
return self.destroy(request, *args, **kwargs)
# изменяем значение value для item
item = obj.item
value = item.value
item.value = int(value) - 1
item.save()

return self.destroy(request, *args, **kwargs)

class OutcomesOfWorkProgramUpdateView(generics.UpdateAPIView):
queryset = OutcomesOfWorkProgram.objects.all()
@@ -627,18 +623,15 @@ class PrerequisitesOfWorkProgramDestroyView(generics.DestroyAPIView):
permission_classes = [IsRpdDeveloperOrReadOnly]

def delete(self, request, *args, **kwargs):
try:
obj = PrerequisitesOfWorkProgram.objects.get(pk=kwargs['pk'])
obj = PrerequisitesOfWorkProgram.objects.get(pk=kwargs['pk'])

# изменяем значение value для item
item = Items.objects.get(name=obj.item)
value = item.value
item.value = int(value) - 1
item.save()
# изменяем значение value для item
item = obj.item
value = item.value
item.value = int(value) - 1
item.save()

return self.destroy(request, *args, **kwargs)
except:
return Response(status=400)
return self.destroy(request, *args, **kwargs)


class PrerequisitesOfWorkProgramUpdateView(generics.UpdateAPIView):