Skip to content

Commit

Permalink
Render broken objects + allow to delete them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz authored and dwt committed Jun 12, 2018
1 parent 7b7e7dd commit 7ebdd63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/OFS/ObjectManager.py
Expand Up @@ -540,9 +540,12 @@ def manage_delObjects(self, ids=[], REQUEST=None):
id = ids[-1]
v = self._getOb(id, self)

if v.wl_isLocked():
raise ResourceLockedError(
'Object "%s" is locked.' % v.getId())
try:
if v.wl_isLocked():
raise ResourceLockedError(
'Object "%s" is locked.' % v.getId())
except AttributeError:
pass

if v is self:
raise BadRequest('%s does not exist' % escape(ids[-1], True))
Expand Down
10 changes: 6 additions & 4 deletions src/OFS/zpt/main.zpt
Expand Up @@ -59,10 +59,12 @@
tal:attributes="value id" />
</td>
<td>
<span tal:attributes="class ob/zmi_icon;
title ob/meta_type">
<span title="Broken object"
class="icon-broken"
tal:attributes="class ob/zmi_icon | default;
title ob/meta_type | default">
<span class="sr-only"
tal:content="ob/meta_type">meta_type</span>
tal:content="ob/meta_type | default">Broken object</span>
</span>
</td>
<td>
Expand All @@ -74,7 +76,7 @@
</span>
</td>
<td>
<a tal:condition="ob/title"
<a tal:condition="ob/title|nothing"
tal:attributes="href string:${id}/manage_workspace"
tal:content="ob/title">Title</a>
</td>
Expand Down

0 comments on commit 7ebdd63

Please sign in to comment.