(self, domain, location_id, fall_back_to_next=False)
Unset a location that the user is assigned to that may or may not be primary location
Unset a location that the user is assigned to that may or may not be primary location
Unset a location that the user is assigned to that may or may not be primary location
def unset_location_by_id(self, domain, location_id, fall_back_to_next=False):
        """
        Unset a location that the user is assigned to that may or may not be primary location
        """
        membership = self.get_domain_membership(domain)
        primary_id = membership.location_id
        if location_id == primary_id:
            # check if primary location
            self.unset_location(domain, fall_back_to_next)
        else:
            membership.assigned_location_ids.remove(location_id)
            self.get_sql_locations.reset_cache(self)
            self.save()
def unset_location_by_id ( self , domain , location_id , fall_back_to_next = False ) : membership = self . get_domain_membership ( domain ) primary_id = membership . location_id if location_id == primary_id : # check if primary location self . unset_location ( domain , fall_back_to_next ) else : membership . assigned_location_ids . remove ( location_id ) self . get_sql_locations . reset_cache ( self ) self . save ( )