fix: resolve Python code quality issues

- Fix undefined variable 'e' in PDF generator error handling
- Replace undefined 'Verpachtung' model references with 'LandVerpachtung'
- Fix all import and object access references to use correct model name
- Resolve all flake8 F821 undefined name errors

This addresses all code quality failures that were blocking CI pipeline.
This commit is contained in:
Stiftung Development
2025-09-06 20:54:20 +02:00
parent 4acb5885e8
commit 54bf468c53
2 changed files with 16 additions and 15 deletions

View File

@@ -1128,8 +1128,8 @@ class DokumentLink(models.Model):
"""Gibt die verknüpfte Verpachtung zurück"""
if self.verpachtung_id:
try:
return Verpachtung.objects.get(pk=self.verpachtung_id)
except Verpachtung.DoesNotExist:
return LandVerpachtung.objects.get(pk=self.verpachtung_id)
except LandVerpachtung.DoesNotExist:
return None
return None