Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Avoid exception during update topology admin action
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Dec 29, 2015
1 parent 19a1f6a commit 365509c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_netjsongraph/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from .models import Topology, Node, Link
from .base import TimeStampedEditableAdmin
from .contextmanagers import log_on_fail


class TopologyAdmin(TimeStampedEditableAdmin):
Expand Down Expand Up @@ -33,7 +34,8 @@ def _message(self, request, rows, suffix):
def update_selected(self, request, queryset):
items = list(queryset)
for item in items:
item.update()
with log_on_fail('update topology admin action', item):
item.update()
self._message(request, len(items), _('successfully updated'))
update_selected.short_description = _('Update selected topologies')

Expand Down

0 comments on commit 365509c

Please sign in to comment.