Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
9.0 KiB

org_names = ["Optivo", "1625 Independent People Ltd.", "A2DOMINION HOMES", "A2DOMINION SOUTH HA Ltd", "Abri Group Ltd.", "Accent Housing Ltd.", "Access Community Trust", "Accomplish Group", "ACKEE HOUSING PROJECT", "ACTION HOMELESS - LEICESTER", "Action Housing and Support Limited", "ADDICTION RECOVERY AGENCY", "ADULLAM HOMES HA Ltd.", "AKSA HA LTD", "Alabare Christian Care and Support", "AMADUDU", "Amicus Trust Ltd.", "ANAH PROJECT", "ANCHOR HANOVER", "ARCHES HOUSING ASSOCIATION LTD.", "ASHA ASIAN WOMENS AID", "ASHIANA", "Association for Spinal Injury Research, Rehabilitation and Reintegration (ASPIRE)", "Aster Communities", "Back on Track Housing", "BANGLA HOUSING ASSOCIATION", "BARNARDOS", "Basildon District Council", "Bassetlaw District Council", "Bernicia", "BEYOND HOUSING", "Birmingham City Council", "Blackburn YMCA (T/A Y Housing)", "BOURNVILLE ALMSHOUSE TRUST", "BOURNVILLE VILLAGE TRUST", "BOURNVILLE WORKS HS Ltd", "BPHA Ltd", "Bradford Cyrenians", "BRENT, WANDSWORTH & WESTMINSTER MIND", "Bridge Mental Health", "Brighter Places", "Bushbury Hill Estate Management Board", "CALICO HOUSING ASSOCIATION", "CAMBRIDGE CYRENIANS", "Caring for Communities and People (CCP)", "Catalyst Housing Ltd.", "Causeway Irish Housing", "CAYSH", "CENTRAL & CECIL HT", "CENTREPOINT", "Certitude (Support for Living)", "Change, Grow, Live", "Changing Lives", "Chartford Housing Limited", "CHELMER HOUSING PARTNERSHIP", "CHERRYTREE SUPPORT SERVICES LTD.", "Cheshire West and Chester Council", "Chorley Community Housing", "Chorus Homes", "City of Bradford Metropolitan District Council", "Clarion Housing Group", "COASTLINE HOUSING", "COMMUNITY LINKS", "CONNECT HOUSING", "Connection Support", "COTMAN HA Ltd", "COVENTRY CYRENIANS", "COVENTRY MIND", "Coventry Refugee and Migrant Centre", "CRANSTOUN DRUG SERVICES", "CREATIVE SUPPORT", "CROSBY HA Ltd", "CROWN SIMMONS HOUSING", "CROYDON CHURCHES HA Ltd", "Curo Choice Ltd", "Curo Places", "DEPAUL UK", "DERWENT HA Ltd", "Dovecotes TMO Ltd", "East Riding of Yorkshire Council", "emh homes", "Evolve Housing and Support", "Expect Ltd.", "FAMILY HELP", "FAMILY MOSAIC HOUSING", "FLAGSHIP HOUSING GROUP LTD", "Forhousing", "FOUNDATION HOUSING (Leeds)", "FRAMEWORK HA", "Funding Affordable Homes Housing Association Ltd.", "FYLDE COAST WOMEN'S AID", "GATEWAY HOUSING ASSOCIATION", "Genesis HA", "GIPSIL", "Gloucester City Homes", "GLOUCESTERSHIRE RURAL HOUSING ASSOCIATION LTD. (GRHA)", "GRAND UNION HOUSING GROUP", "GRAVESEND CHURCHES HA Ltd", "Great Places Housing Association", "GreenSquare Accord", "GreenSquare Group", "Grimsby and Cleethorpes Area Doorstep", "HALTON YMCA", "Harbour Support Services", "HARROGATE FLOWER FUND HOMES", "Harrogate Housing Association Limited", "HAVEBURY HOUSING PARTNERSHIP", "Heart of Medway Housing Association Ltd", "HESTIA HOUSING AND SUPPORT", "HEXAGON HA", "Hightown Housing Association Limited", "HINCKLEY HOMELESS", "HITS HOMES TRUST", "HOME GROUP [1199]", "Homeless Link [software company]", "Homeless Oxfordshire Ltd.", "Honeycomb Charitable Services Ltd.", "Honeycomb Group Ltd.", "HORTON HOUSING ASSOCIATION", "Housing and Care 21", "HOUSING FOR WOMEN", "HUDDERSFIELD WOMEN'S AID", "HULL & EAST YORKSHIRE MIND", "Humankind", "HUNDRED HOUSES SOCIETY", "HYDE HA Group", "HYNDBURN HOMES", "I Choose Freedom", "Imagine Mental Health", "IMPACT HOUSING ASSOCIATION", "Impakt Housing and Support", "Incommunities", "IRWELL VALLEY HA Ltd", "ISLINGTON & SHOREDITCH HA Ltd", "Jigsaw Homes North", "Jigsaw Homes Tameside", "Karbon Homes", "KIRKLEES ASIAN AND BLACK WOMEN'S WELFARE ASSOCIATION (KABWWA)", "KURDISH HA", "Lancashire Mind", "Latin American Women's Aid Refuge (LAWA)", "LDN London", "LEEDS FEDERATED HOUSING ASSOCIATION", "LEEDS WOMEN'S AID", "Legal & General Affordable Homes", "LEICESTER HA Ltd", "Leicestershire Rural Housing Association", "Lewisham Homes", "LIFE CARE AND HOUSING TRUST", "LiveWest Homes Ltd.", "LONDON & QUADRANT", "LONDON AND QUADRANT (L&Q) HOUSING TRUST", "London Borough of Hounslow", "London Borough of Lewisham", "Longhurst & Havelok Homes Ltd", "LOOK AHEAD CARE, SUPPORT AND HOUSING", "MANNINGHAM HA LTD", "MARSHA PHOENIX MEMORIAL TRUST", "MARTLET HOMES Ltd", "MCCH", "MERLIN HOUSING SOCIETY", "METROPOLITAN HOME OWNERSHIP Ltd.", "METROPOLITAN HOUSING TRUST LTD.", "MHS HOMES LTD", "MIDLAND HEART LTD.", "Milton Keynes Borough Council", "MISSING LINK", "MITRE HA Ltd", "MOAT HOMES Ltd", "Mosscare St Vincent's (MSV) Housing Group Ltd.", "MOUNT CARMEL", "NACRO", "Network Homes", "NEW HOPE", "NewArch Homes", "NEWLON HOUSING TRUST", "Next Link Housing", "Nomad Opening Doors", "North Kent MIND", "North Star Housing Group", "Northampton Domestic Abuse Service (NDAS)", "NORTHAMPTONSHIRE RURAL HOUSING ASSOCIATION", "NORTON HOUSING AND SUPPORT", "NOTTING HILL GENESIS", "NOTTING HILL HOME OWNERSHIP Ltd.", "Nottingham Community Housing Association Limited", "Nottinghamshire Women's Aid", "Oldham Metropolitan Borough Council", "Ongo Homes Limited", "Onward Homes", "ORBIT HOUSING ASSOCIATION LTD.", "ORIGIN HOUSING", "ORWELL HOUSING ASSOCIATION LTD.", "OUTLOOK CARE Ltd.", "OUTWARD HOUSING ASSOCIATION", "OXFORDSHIRE MIND", "P3", "PA Housing Limited", "PANAHGHAR", "Pathways to Independence Ltd.", "PEABODY TRUST", "PEAK DISTRICT RURAL HOUSING ASSOCIATION", "Personal Services Society (PSS)", "PHOENIX FUTURES", "Pinnacle Affordable Homes Ltd.", "Pinnacle Housing", "Pinnacle Spaces Ltd.", "PLACES FOR PEOPLE HOMES", "PLACES FOR PEOPLE LIVING+", "POPLAR HARCA Ltd.", "PRESENTATION HA Ltd", "Prima Group", "PROGRESS HOUSING ASSOCIATION LTD.", "RAVEN HOUSING TRUST", "REFUGE", "Regenda Homes", "ReSi Homes Ltd.", "ReSI Housing Limited", "RETHINK MENTAL ILLNESS", "RICHMOND FELLOWSHIP", "RIVERSIDE HOUSING GROUP", "Rooftop Housing Association Limited", "ROTHERHAM RISE", "ROUNDABOUT LTD.", "Royal Borough of Greenwich", "RUSH HOUSE", "SafeNet Domestic Abuse Service", "SAFERPLACES", "SALTASH HS LTD", "SALVATION ARMY", "SALVATION ARMY HA Ltd", "Sanctuary Affordable Housing Limited", "SANCTUARY HA", "SAXON WEALD", "SECOND STEP HA LTD", "Sheffield City Council", "SHEPHERD'S BUSH HA", "SINGLE HOMELESS PROJECT", "SINGLE PERSONS EMERG. ACCOMM IN RICHMOND (SPEAR)", "Solace Women's Aid", "SOUTH YORKSHIRE HA Ltd", "SOUTHDOWN HA", "SOUTHERN HOUSING", "SOUTHERN HOUSING HOME OWNERSHIP", "SOVEREIGN HA", "SPITALFIELDS CRYPT TRUST", "ST BASILS HA Ltd", "ST MICHAELS FELLOWSHIP", "St Mungo's", "Staying Put", "STOKE ON TRENT GINGERBREAD", "Stonewater Limited", "STONHAM HA Ltd", "STOPOVER", "STROUD BERESFORD LIMITED", "SUFFOLK MIND", "SWAN HA", "Swindon Women's Aid", "SYNERGY HOUSING LIMITED", "TARGET HA", "TAUNTON ASSN FOR THE HOMELESS HA Ltd", "THAMES REACH", "THAMES VALLEY CHARITABLE HA Ltd.", "The Albert Kennedy Trust", "The ExtraCare Charitable Trust", "The Guinness Partnership", "THE HAVEN WOLVERHAMPTON", "The Nehemiah Project", "THE OAKLEA TRUST", "The Square Building Trust Limited", "THE VILLAGES HA Ltd", "The Wish Centre", "The YOU Trust", "THRESHOLD HOUSING PROJECT", "THT and L&Q Community Limited (TLQCM)", "Thurrock Council", "Together for Mental Wellbeing", "Together Housing Group", "TOUCHSTONE", "TOWN AND COUNTRY HOUSING", "TRAFFORD HOUSING TRUST LTD", "TRANSFORM HOUSING AND SUPPORT", "Trinity Homeless Projects", "TUNTUM HA", "Turning Lives Around", "TURNING POINT", "TWO SAINTS", "TYNE HA", "UNITED RESPONSE", "UNITY HA LTD", "VALLEY HOUSE", "VIBRANCE", "VIRIDIAN HOUSING", "VIVID", "WANDLE HA Ltd", "WAY HA LTD", "Westlea Housing Association", "Wolverhampton City Council", "Wolverhampton Homes", "Women's Aid Bromley and Croydon", "Women's Aid Leicestershire Ltd.", "WOMEN'S PIONEER HOUSING Ltd.", "Wythenshawe Community Housing Group (WCHG)", "YMCA Brunel Group", "YMCA Downslink Group", "YMCA Fylde Coast", "YORKSHIRE HOUSING LIMITED", "Young Devon", "YOUNG WOMEN'S HOUSING PROJECT (YWHP)", "Your Housing Ltd.", "YWCA Yorkshire","Reigate and Banstead Borough Council","Hilldale Housing Association","TorVista Homes","Flint Housing Limited","New Park Village TMC","TOWER HAMLETS COMMUNITY HOUSING","Habitare Homes Ltd.","Spelthorne Borough Council","Leeds Irish Health and Homes","Park Properties Housing Association","Opendoor Homes","Barnet Homes","CREWE AND DISTRICT YMCA","Cirencester Housing Limited","Empower Housing Association","SHIAN HA Ltd","Equinox","PETER BEDFORD HOUSING ASSOCIATION Ltd.","S4B","Halo Housing Association"]
def delete_organisations(org_names)
i = 0
org_names.each do |org_name|
i += 1
org = Organisation.find_by(name: org_name)
if org.blank?
p "#{i} of #{org_names.count}: Org #{org_name} not found, skipping"
next
end
org.parent_organisation_relationships.destroy_all
org.child_organisation_relationships.destroy_all
org.users.each { |u| u.legacy_users.destroy_all }
org.users.destroy_all
org.owned_lettings_logs.destroy_all
org.owned_sales_logs.destroy_all
org.managed_lettings_logs.destroy_all
org.owned_schemes.each { |s| s.lettings_logs.destroy_all }
org.owned_schemes.destroy_all
org.destroy!
p "#{i} of #{org_names.count}: #{org_name} and associated objects deleted"
end
#remember to delete logs that have been assigned to no orgs so they can reimport successfully
end
delete_organisations(org_names)