Example #1
0
def delete(request, collection_id=None):
    """Deletes a collection."""

    services.delete_collection(collection_id)
    response = redirect('collectionIndex')
    response['Location'] += '?instructor=edit'
    log.info('Collection %(c)s deleted.' % {'c': str(collection_id)},
             extra={'user': request.user})
    analytics.track(actor=request.user,
                    verb=analytics.VERBS.deleted,
                    object=analytics.OBJECTS.collection,
                    context={"collection_id": collection_id})
    return response
Example #2
0
def delete(request, collection_id=None):
    """Deletes a collection."""

    services.delete_collection(collection_id)
    response = redirect('collectionIndex')
    response['Location'] += '?instructor=edit'
    log.info('Collection %(c)s deleted.' %{'c': str(collection_id)}, extra={'user': request.user})
    analytics.track(
        actor=request.user,
        verb=analytics.VERBS.deleted,
        object=analytics.OBJECTS.collection,
        context={"collection_id": collection_id}
    )
    return response
Example #3
0
 def test_deleteCollection(self):
     collection = self.make_collection()
     self.assertEqual(services.delete_collection(collection.id), True)
Example #4
0
 def test_deleteCollection(self):
     collection = self.make_collection()
     self.assertEqual(services.delete_collection(collection.id), True)