Since you've provided no detailed information on what unsafe conditions existed, what you did to notify your landlord and how much time you gave them to remedy the situation, no one here can tell you whether you deserve to get your deposit back.
If you have asked for your deposit and the landlord/management refuses, the next step is to consider a lawsuit.
Gail