refactor: Simplify instance creation by removing unnecessary parameters and error handling
This commit is contained in:
@@ -104,7 +104,7 @@ class instace:
|
||||
def __init__():
|
||||
return list()
|
||||
|
||||
def new(name: str, address: str, postal_code: str, city: str, school_number: str, it_admin: str) -> int:
|
||||
def new(name: str) -> int:
|
||||
"""
|
||||
Generates a new instance with the subdomain [name].invario.eu
|
||||
|
||||
@@ -121,19 +121,6 @@ class instace:
|
||||
|
||||
if execute_script(_var, _cmd, "add", clear_special(name), port):
|
||||
add_dns(name, port)
|
||||
try:
|
||||
necessary_info = {
|
||||
"name": f"name={name}",
|
||||
"address": f"address={address}",
|
||||
"postal_code": f"postal_code={postal_code}",
|
||||
"city": f"city={city}",
|
||||
"school_number": f"school_number={school_number}",
|
||||
"it_admin": f"it_admin={it_admin}"
|
||||
}
|
||||
if execute_script(_var, _cmd, "school", clear_special(name), str(necessary_info)):
|
||||
pass
|
||||
except:
|
||||
return False
|
||||
return int(port)
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -518,7 +518,7 @@
|
||||
<div class="nav-links" id="mainNav" aria-label="Main Navigation" aria-hidden="true">
|
||||
<a href="{{ url_for('default') }}">Start</a>
|
||||
<a href="{{ url_for('dienstleistungen') }}">Für Schulen</a>
|
||||
<a href="{{ url_for('preise') }}">Preise</a>
|
||||
<a href="{{ url_for('team') }}">Team</a>
|
||||
<a href="{{ url_for('kontakt') }}">Kontakt</a>
|
||||
{% if session.get('is_admin') %}
|
||||
<a class="nav-user-link" href="{{ url_for('admin_invoices') }}">Rechnungsverwaltung</a>
|
||||
|
||||
Reference in New Issue
Block a user