angestoepselt: Laptop-Option hinzufügen

This commit is contained in:
Yannik Rödel 2025-08-02 09:58:24 +00:00
parent 6bc9481f06
commit a3a2e2e9a5
2 changed files with 22 additions and 7 deletions

View file

@ -43,11 +43,13 @@ EMAIL_REGEX = re.compile(r"^[^ ]+@[^ ]+\.[^ ]+$")
# repository) to the corresponding Zammad categories:
# https://codeberg.org/angestoepselt/homepage/issues/120#issuecomment-1727768
# This is a (str | int) -> str map because some keys we check against below might be
# integers and it's just easier to type this way.
# integers and it's just easier to type this way. Edit this list upstream here:
# https://ticket.z31.it/#system/object_manager
FORM_CATEGORY_MAP: dict[str | int, str] = {
"Laptop": "laptop",
"Laptop ohne Akku": "laptop-battery-missing",
"Desktop-Computer": "desktop",
"Tablet": "tablet",
}
SITE_DIRECTORY = os.environ.get("SITE_DIRECTORY", "")
@ -247,10 +249,10 @@ match request_uri:
case "/computer-beantragen/privat":
form_name = "Computerantrag (privat)"
form_group = "csw-Anfragen"
ticket_details["Gewünschte Hardware"] = get_form_value("hardware", default="Unbekannt")
form_category = FORM_CATEGORY_MAP.get(ticket_details["Gewünschte Hardware"], None)
ticket_details["Adresse"] = get_form_value("addressline")
ticket_details["PLZ"] = get_form_value("postalcode")
ticket_details["Stadt"] = get_form_value("city")

View file

@ -1,8 +1,21 @@
{
"applicationsClosed": true,
"devices": [
{ "name": "Laptop", "available": true },
{ "name": "Laptop ohne Akku", "available": true },
{ "name": "Desktop-Computer", "available": true }
{
"name": "Laptop",
"available": true
},
{
"name": "Laptop ohne Akku",
"available": true
},
{
"name": "Desktop-Computer",
"available": true
},
{
"name": "Tablet",
"available": true
}
]
}
}