diff --git a/mpwo_api/mpwo_api/activities/models.py b/mpwo_api/mpwo_api/activities/models.py index 4e9a0e4a..e12bebd3 100644 --- a/mpwo_api/mpwo_api/activities/models.py +++ b/mpwo_api/mpwo_api/activities/models.py @@ -20,7 +20,8 @@ class Sport(db.Model): def serialize(self): return { 'id': self.id, - 'label': self.label + 'label': self.label, + '_can_be_deleted': len(self.activities) == 0 } diff --git a/mpwo_client/src/components/Admin/generic/AdminDetail.jsx b/mpwo_client/src/components/Admin/generic/AdminDetail.jsx index 77cb9bd8..6950aa8a 100644 --- a/mpwo_client/src/components/Admin/generic/AdminDetail.jsx +++ b/mpwo_client/src/components/Admin/generic/AdminDetail.jsx @@ -45,8 +45,9 @@ class AdminDetail extends React.Component {