diff --git a/network/communication.py b/network/communication.py index a53e975..eee77fb 100644 --- a/network/communication.py +++ b/network/communication.py @@ -150,6 +150,21 @@ class Server(): response.status_code = 400 return response + def update_client_data(request_user, self): + request_content_type = request.headers.get('Content-Type') + if request_content_type == 'application/json': + json_object = request.json + try: + pass + except Exception as ex: + response = jsonify({ + "message": "Internal server error", + "data": None, + "error": str(ex) + }) + response.status_code = 400 + return response + def run(self): # add admin user to dataabse (or update existing one) salt = bcrypt.gensalt() diff --git a/utils/models/__pycache__/models.cpython-310.pyc b/utils/models/__pycache__/models.cpython-310.pyc index 495f88d..7e2264e 100644 Binary files a/utils/models/__pycache__/models.cpython-310.pyc and b/utils/models/__pycache__/models.cpython-310.pyc differ diff --git a/utils/models/models.py b/utils/models/models.py index b745440..88461b5 100644 --- a/utils/models/models.py +++ b/utils/models/models.py @@ -21,6 +21,7 @@ class Client(Base): vm_list_on_machine = relationship( "VMImage", secondary=client_image_table, + back_populates="clients" ) def has_vm_installed(self, vm_object): @@ -43,7 +44,8 @@ class VMImage(Base): image_name_version_combo = Column(String(600), nullable=False, unique=True) clients = relationship( "Client", - secondary=client_image_table + secondary=client_image_table, + back_populates="vm_list_on_machine" ) def as_dict(self):