docs: def active_repositories(doc):
      """View for getting active repositories"""
      if doc.get('state') != 'deactivated':
          for repository_id, repo in doc.get('repositories', {}).items():
              if repo.get('state') != 'deactivated':
                  repo['id'] = repository_id
                  repo['organisation_id'] = doc['_id']
  
                  yield repository_id, repo