1
0
Fork 0

cleanup debugmess in views.py

This commit is contained in:
Kevin Muller 2025-03-19 16:22:31 +01:00
parent bc44d7fe05
commit caef7e737e

View file

@ -1,7 +1,6 @@
from enum import Enum
import json
import subprocess
import threading
import os
from django.urls import reverse_lazy
@ -10,13 +9,8 @@ from django.contrib.auth.models import User
from django.views.generic import TemplateView, DetailView
from django.views.generic.edit import FormView
from time import sleep
from panel import models
from panel.configuration import forms
class Index(TemplateView):
template_name = 'index.html'
@ -95,10 +89,6 @@ class ConfigurationForm(LoginRequiredMixin, FormView):
obj.value = form.to_python().model_dump_json()
obj.save()
print('-------------debug-------------')
print(self.request.POST)
print('-------------debug-------------')
if "deploy" in self.request.POST.keys():
#threading.Thread(target=self.run_deployment, args=(obj,)).start()
print("DEPLOYING:")
@ -131,9 +121,6 @@ class ConfigurationForm(LoginRequiredMixin, FormView):
"apply",
"test",
]
# print('start deployment')
# sleep(10)
# print('done with deployment')
subprocess.run(cmd, cwd=os.getenv("REPO_DIR") or f"{os.getcwd()}/..", env=env)
return super().form_valid(form)