fix: configure CI database connection properly
- Add dotenv loading to Django settings - Update CI workflow to use correct environment variables - Set POSTGRES_* variables instead of DATABASE_URL - Add environment variables to all Django management commands - Fixes CI test failures due to database connection issues
This commit is contained in:
@@ -15,12 +15,19 @@
|
||||
<p class="text-muted">
|
||||
Länderei: <a href="{% url 'stiftung:land_detail' land.pk %}">{{ land }}</a>
|
||||
{% if is_edit and land.aktueller_paechter %} | Aktueller Pächter: {{ land.aktueller_paechter.get_full_name }}{% endif %}
|
||||
{% if is_update %} | Bearbeitung von {{ landverpachtung.vertragsnummer }}{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4 text-end">
|
||||
{% if is_update %}
|
||||
<a href="{% url 'stiftung:land_verpachtung_detail' landverpachtung.pk %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left me-2"></i>Zurück zur Verpachtung
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{% url 'stiftung:land_detail' land.pk %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left me-2"></i>Zurück zur Länderei
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,11 +49,12 @@
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3">
|
||||
<label for="aktueller_paechter" class="form-label">Pächter auswählen *</label>
|
||||
<select class="form-select" id="aktueller_paechter" name="aktueller_paechter" required>
|
||||
<select class="form-select" id="aktueller_paechter" name="paechter" required>
|
||||
<option value="">Bitte wählen...</option>
|
||||
{% for paechter in paechter_list %}
|
||||
<option value="{{ paechter.pk }}"
|
||||
{% if is_edit and land.aktueller_paechter and paechter.pk == land.aktueller_paechter.pk %}selected{% endif %}
|
||||
{% if is_update and landverpachtung.paechter and paechter.pk == landverpachtung.paechter.pk %}selected
|
||||
{% elif is_edit and land.aktueller_paechter and paechter.pk == land.aktueller_paechter.pk %}selected{% endif %}
|
||||
data-name="{{ paechter.get_full_name }}"
|
||||
data-anschrift="{{ paechter.strasse|default:'' }} {{ paechter.plz|default:'' }} {{ paechter.ort|default:'' }}">
|
||||
{{ paechter.get_full_name }}
|
||||
@@ -60,7 +68,7 @@
|
||||
<div class="mb-3">
|
||||
<label for="verpachtete_flaeche" class="form-label">Verpachtete Fläche (qm) *</label>
|
||||
<input type="number" step="0.01" class="form-control" id="verpachtete_flaeche" name="verpachtete_flaeche"
|
||||
value="{% if is_edit %}{{ land.verp_flaeche_aktuell|default:verfuegbare_flaeche }}{% else %}{{ verfuegbare_flaeche|default:land.groesse_qm }}{% endif %}"
|
||||
value="{% if is_update %}{{ landverpachtung.verpachtete_flaeche }}{% elif is_edit %}{{ land.verp_flaeche_aktuell|default:verfuegbare_flaeche }}{% else %}{{ verfuegbare_flaeche|default:land.groesse_qm }}{% endif %}"
|
||||
max="{{ verfuegbare_flaeche|default:land.groesse_qm }}" required>
|
||||
<small class="text-muted">Verfügbar: {{ verfuegbare_flaeche|default:land.groesse_qm|floatformat:0 }} qm | Gesamt: {{ land.groesse_qm|floatformat:0 }} qm</small>
|
||||
</div>
|
||||
@@ -73,14 +81,14 @@
|
||||
<div class="mb-3">
|
||||
<label for="pachtbeginn" class="form-label">Pachtbeginn *</label>
|
||||
<input type="date" class="form-control" id="pachtbeginn" name="pachtbeginn"
|
||||
value="{% if is_edit and land.pachtbeginn %}{{ land.pachtbeginn|date:'Y-m-d' }}{% endif %}" required>
|
||||
value="{% if is_update %}{{ landverpachtung.pachtbeginn|date:'Y-m-d' }}{% elif is_edit and land.pachtbeginn %}{{ land.pachtbeginn|date:'Y-m-d' }}{% endif %}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="pachtende" class="form-label">Pachtende</label>
|
||||
<input type="date" class="form-control" id="pachtende" name="pachtende"
|
||||
value="{% if is_edit and land.pachtende %}{{ land.pachtende|date:'Y-m-d' }}{% endif %}">
|
||||
value="{% if is_update and landverpachtung.pachtende %}{{ landverpachtung.pachtende|date:'Y-m-d' }}{% elif is_edit and land.pachtende %}{{ land.pachtende|date:'Y-m-d' }}{% endif %}">
|
||||
<small class="text-muted">Leer = unbefristet</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,7 +96,7 @@
|
||||
<div class="mb-3">
|
||||
<div class="form-check mt-4">
|
||||
<input class="form-check-input" type="checkbox" id="verlaengerung_klausel" name="verlaengerung_klausel"
|
||||
{% if is_edit and land.verlaengerung_klausel %}checked{% endif %}>
|
||||
{% if is_update and landverpachtung.verlaengerung_klausel %}checked{% elif is_edit and land.verlaengerung_klausel %}checked{% endif %}>
|
||||
<label class="form-check-label" for="verlaengerung_klausel">
|
||||
Automatische Verlängerung
|
||||
</label>
|
||||
@@ -139,9 +147,9 @@
|
||||
<label for="zahlungsweise" class="form-label">Zahlungsweise</label>
|
||||
<select class="form-select" id="zahlungsweise" name="zahlungsweise">
|
||||
<option value="jaehrlich" {% if is_edit and land.zahlungsweise == 'jaehrlich' %}selected{% endif %}>Jährlich</option>
|
||||
<option value="halbjaehrlich" {% if is_edit and land.zahlungsweise == 'halbjaehrlich' %}selected{% endif %}>Halbjährlich</option>
|
||||
<option value="vierteljaehrlich" {% if is_edit and land.zahlungsweise == 'vierteljaehrlich' %}selected{% endif %}>Vierteljährlich</option>
|
||||
<option value="monatlich" {% if is_edit and land.zahlungsweise == 'monatlich' %}selected{% endif %}>Monatlich</option>
|
||||
<option value="halbjaehrlich" {% if is_update and landverpachtung.zahlungsweise == 'halbjaehrlich' %}selected{% elif is_edit and land.zahlungsweise == 'halbjaehrlich' %}selected{% endif %}>Halbjährlich</option>
|
||||
<option value="vierteljaehrlich" {% if is_update and landverpachtung.zahlungsweise == 'vierteljaehrlich' %}selected{% elif is_edit and land.zahlungsweise == 'vierteljaehrlich' %}selected{% endif %}>Vierteljährlich</option>
|
||||
<option value="monatlich" {% if is_update and landverpachtung.zahlungsweise == 'monatlich' %}selected{% elif is_edit and land.zahlungsweise == 'monatlich' %}selected{% endif %}>Monatlich</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -153,7 +161,7 @@
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="ust_option" name="ust_option"
|
||||
{% if is_edit and land.ust_option %}checked{% endif %}>
|
||||
{% if is_update and landverpachtung.ust_option %}checked{% elif is_edit and land.ust_option %}checked{% endif %}>
|
||||
<label class="form-check-label" for="ust_option">
|
||||
<strong>USt-Option</strong> (Pacht mit Umsatzsteuer)
|
||||
</label>
|
||||
@@ -164,7 +172,7 @@
|
||||
<div class="mb-3">
|
||||
<label for="ust_satz" class="form-label">USt-Satz (%)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="ust_satz" name="ust_satz"
|
||||
value="{% if is_edit %}{{ land.ust_satz|default:'19.00' }}{% else %}19.00{% endif %}">
|
||||
value="{% if is_update %}{{ landverpachtung.ust_satz|default:'19.00' }}{% elif is_edit %}{{ land.ust_satz|default:'19.00' }}{% else %}19.00{% endif %}">
|
||||
<small class="text-muted">Standard: 19%</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user