Merge pull request 'master' (#279) from master into Docker
Reviewed-on: SGD-Nord/konova#279
This commit is contained in:
commit
6d725416df
@ -203,7 +203,12 @@ def detail_view(request: HttpRequest, id: str):
|
||||
|
||||
"""
|
||||
template = "compensation/detail/compensation/view.html"
|
||||
comp = get_object_or_404(Compensation, id=id)
|
||||
comp = get_object_or_404(
|
||||
Compensation,
|
||||
id=id,
|
||||
deleted=None,
|
||||
intervention__deleted=None,
|
||||
)
|
||||
geom_form = SimpleGeomForm(instance=comp)
|
||||
parcels = comp.get_underlying_parcels()
|
||||
_user = request.user
|
||||
|
@ -184,7 +184,8 @@ def detail_view(request: HttpRequest, id: str):
|
||||
'geometry',
|
||||
'responsible',
|
||||
),
|
||||
id=id
|
||||
id=id,
|
||||
deleted=None,
|
||||
)
|
||||
geom_form = SimpleGeomForm(instance=acc)
|
||||
parcels = acc.get_underlying_parcels()
|
||||
|
@ -143,7 +143,8 @@ def detail_view(request: HttpRequest, id: str):
|
||||
"legal",
|
||||
"responsible",
|
||||
),
|
||||
id=id
|
||||
id=id,
|
||||
deleted=None
|
||||
)
|
||||
compensations = intervention.compensations.filter(
|
||||
deleted=None,
|
||||
|
@ -87,7 +87,7 @@ class AbstractDocument(BaseResource):
|
||||
"""
|
||||
try:
|
||||
os.remove(self.file.file.name)
|
||||
except FileNotFoundError:
|
||||
except (FileNotFoundError, ValueError):
|
||||
# File seems to missing anyway - continue!
|
||||
pass
|
||||
super().delete(using=using, keep_parents=keep_parents)
|
||||
@ -113,7 +113,7 @@ class AbstractDocument(BaseResource):
|
||||
"""
|
||||
try:
|
||||
os.remove(self.file.file.name)
|
||||
except FileNotFoundError:
|
||||
except (FileNotFoundError, ValueError):
|
||||
pass
|
||||
self.file = new_file
|
||||
self.save()
|
||||
self.save()
|
||||
|
Loading…
Reference in New Issue
Block a user