def remove(self, activity): if not self.contains(activity): raise feedly_exceptions.ActivityNotFound() if len(self.activities) == 1: raise ValueError( 'removing this activity would leave an empty aggregation') # remove the activity self.activities.remove(activity) # now time to update the times self.updated_at = self.last_activity.time # adjust the count if self.minimized_activities: self.minimized_activities -= 1
def remove(self, activity): if not self.contains(activity): raise feedly_exceptions.ActivityNotFound() if len(self.activities) == 1: raise ValueError( 'removing this activity would leave an empty aggregation') # remove the activity activity_id = getattr(activity, 'serialization_id', activity) self.activities = [ a for a in self.activities if a.serialization_id != activity_id ] # now time to update the times self.updated_at = self.last_activity.time # adjust the count if self.minimized_activities: self.minimized_activities -= 1