(self)
Unarchive a location and reopen supply point case if it
        exists.
Unarchive a location and reopen supply point case if it
        exists.
Unarchive a location and reopen supply point case if it exists .
def unarchive(self):
        """
        Unarchive a location and reopen supply point case if it
        exists.
        """
        import itertools
        from corehq.apps.users.models import CommCareUser
        for loc in itertools.chain(self.get_descendants(include_self=True), self.get_ancestors()):
            loc.is_archived = False
            loc.archived_on = None
            loc.save()

            if loc.user_id:
                user = CommCareUser.get(loc.user_id)
                user.active = True
                user.save()
def unarchive ( self ) : import itertools from corehq . apps . users . models import CommCareUser for loc in itertools . chain ( self . get_descendants ( include_self = True ) , self . get_ancestors ( ) ) : loc . is_archived = False loc . archived_on = None loc . save ( ) if loc . user_id : user = CommCareUser . get ( loc . user_id ) user . active = True user . save ( )