def set_coordinates(request): form = AccountSetGCoordinates( request.POST or None, instance=request.user) if request.method == 'POST': if form.is_valid(): form.save() return {'form': form}
def purge_coordinates(request): request.user.glat = None request.user.glng = None request.user.save() form = AccountSetGCoordinates( request.POST or None, instance=request.user) if request.method == 'POST': if form.is_valid(): form.save() return {'form': form}